2019 Multi-University Training Contest 2 - 1011 - Keen On Everything But Triangle - 线段树

http://acm.hdu.edu.cn/showproblem.php?pid=6601

First of all want to be greedy, subject to the longest side length, then how to construct it? In a contiguous section which, necessarily come out than three longest, so must be the largest (nonsense). And if it fails triangle composed of the longest Flanagan this time on useless.

Consider a critical situation, that is just not a good time to make up the triangle, to arrange more stick as much as possible within 1e9, it may wish to: 1,1,2,3,5,8 ...... That is Fibonacci of number. It can be found to break out at about 43 times the already close 1e9.

Each section is only really useful longest 50.

Consider the establishment of segment tree for each segment, which segment tree to save the current longest interval up to 50.

Guess you like

Origin www.cnblogs.com/Yinku/p/11240470.html