【BZOJ 3482】[COCI2013] hiperprostor

相关链接

题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3482
神犇题解:http://www.cnblogs.com/clrs97/p/4675155.html

解题报告

我们发现一条路径的长度为$ax+b$,是一条直线的形式
那么我们如果求出所有直线的凸包,那么就可以$O(n)$计算答案了

现在考虑如何搞出凸包:

若两条直线的斜率相等,那么纵截距较小的一定优于纵截距较大的
于是我们可以定义状态$f_{i,j}$表示到达$i$点,斜率为$j$,的路径纵截距最小是多少
这个我们可以使用Dijkstra搞出来,之后我们显然可以$O(n)$构造出凸包了

有了凸包后,每一条线段的贡献就是一个等差数列,这个显然可以$O(1)$计算
于是总的时间复杂度就是$O(Qn^2 \log (n^2))$

174 thoughts to “【BZOJ 3482】[COCI2013] hiperprostor”

  1. I’m very happy to find this great site. I wanted to thank you for your time for this fantastic read!!
    I definitely appreciated every bit of it and I have you saved as
    a favorite to see new information in your web site.

  2. I’ve learn a few excellent stuff here. Certainly worth bookmarking for revisiting.

    I surprise how so much attempt you put to create any such excellent informative web site.

  3. An intriguing discussion is definitely worth comment. There’s no doubt that that
    you should write more on this issue, it
    might not be a taboo matter but generally people do not speak about these topics.
    To the next! Kind regards!!

  4. Fantastic goods from you, man. I’ve take note your stuff prior to and you’re simply extremely magnificent.
    I actually like what you’ve bought here,
    really like what you are saying and the best way during which you assert it.
    You are making it enjoyable and you still care for to keep it sensible.
    I can not wait to learn far more from you.
    This is really a wonderful website.

  5. An impressive share! I have just forwarded this onto a co-worker who had been doing a little research on this.

    And he actually ordered me breakfast because I discovered it
    for him… lol. So let me reword this…. Thanks for the
    meal!! But yeah, thanx for spending time to
    discuss this issue here on your internet site.

  6. Having read this I thought it was extremely enlightening.
    I appreciate you finding the time and energy to put this article together.
    I once again find myself spending way too much time both reading and
    leaving comments. But so what, it was still worth it!

  7. This is very fascinating, You are an overly professional blogger.
    I’ve joined your rss feed and look forward to seeking more of your wonderful post.
    Additionally, I’ve shared your web site in my social networks

  8. Having read this I thought it was very informative.
    I appreciate you taking the time and effort to put this
    information together. I once again find myself personally spending way too much time both reading and leaving comments.
    But so what, it was still worth it!

  9. What’s Going down i am new to this, I stumbled upon this I’ve discovered It positively helpful and it has aided me out loads. I am hoping to contribute & help other customers like its aided me. Good job.

  10. Howdy I am so glad I found your site, I really found you by accident, while I was looking on Digg for something else, Anyhow
    I am here now and would just like to say thanks for a tremendous post and a all round exciting blog (I also
    love the theme/design), I don’t have time to look over it all at the moment
    but I have book-marked it and also included your RSS feeds,
    so when I have time I will be back to read much more, Please do keep up the excellent b.

  11. Just desire to say your article is as surprising. The clearness to your put up
    is simply nice and i can assume you’re knowledgeable on this subject.
    Well with your permission let me to grab your RSS feed
    to keep updated with coming near near post. Thanks one million and please continue the
    rewarding work.

  12. Terrific paintings! That is the type of info that are supposed to be shared across the internet. Shame on Google for not positioning this publish higher! Come on over and seek advice from my website . Thanks =)

Leave a Reply

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