【BZOJ 3897】Power

相关链接

题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3897
神犇题解:http://blog.csdn.net/jiangyuze831/article/details/44701467

解题报告

我们考虑给定一个区间$[l,r]$的起始体力值和最终体力值
那么显然我们应该把尽量多的体力值分配到收益最大的那一天$i$
然后$(i,r]$那一部分成了递归子问题,直接分治下去就可以了

至于前面那一部分,如果一直蓄力都不会满,那么就一直蓄力
否则的话,假设从第$j$天开始蓄力会满掉那么我们递归$[l,j-1]$即可
于是我们撸一发分治就可以了,时间复杂度:$O(n)$

15 thoughts to “【BZOJ 3897】Power”

  1. I¦ve been exploring for a little for any high-quality articles or weblog posts on this sort of area . Exploring in Yahoo I finally stumbled upon this website. Studying this info So i am satisfied to express that I’ve an incredibly just right uncanny feeling I discovered exactly what I needed. I so much indubitably will make sure to do not omit this site and provides it a glance regularly.

  2. 451095 311518 Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content material from other writers and practice a bit something from their store. Id prefer to use some with the content on my weblog whether you dont mind. Natually Ill give you a link on your internet weblog. Thanks for sharing. 921540

  3. 207955 127490This design is steller! You definitely know how to maintain a reader entertained. Between your wit and your videos, I was almost moved to start my own weblog (effectively, almostHaHa!) Great job. I genuinely enjoyed what you had to say, and a lot more than that, how you presented it. Too cool! 901274

  4. 118574 496412We stumbled over here coming from a different web page and thought I might check things out. I like what I see so now im following you. Look forward to exploring your web page yet once again. 839168

  5. 42091 95320Admiring the time and effort you put into your site and in depth details you offer. Its excellent to come across a blog every once in a while that isnt the same out of date rehashed material. Excellent read! Ive saved your web site and Im including your RSS feeds to my Google account. 342178

  6. 477296 299926Pretty section of content material. I just stumbled upon your website and in accession capital to assert that I get in fact enjoyed account your weblog posts. Any way Ill be subscribing to your feeds and even I achievement you access consistently quickly. 341519

  7. 76482 416526 Youre so cool! I dont suppose Ive read anything like this before. So good to find somebody with some original thoughts on this subject. realy thank you for starting this up. this site is something that is required on the internet, someone with a bit originality. useful job for bringing something new to the internet! 401504

  8. 484248 279251As a result youll demand ultra powerful online enterprise ideas to maintain operating in acquiring into matters proper your incredible web-based work. MLM 449726

  9. It’s a shame you don’t have a donate button! I’d certainly donate to this excellent blog! I suppose for now i’ll settle for book-marking and adding your RSS feed to my Google account. I look forward to fresh updates and will share this blog with my Facebook group. Chat soon!

Leave a Reply

Your email address will not be published. Required fields are marked *