![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
segment tree
脳漿炸裂
しょうなんの海--who will be with me next time?
展开
-
HDU 1394 Minimum Inversion Number
Thinking: Actually this problem can be solved in a violent way, which is not recommended. Here we made use of segment tree. The basic idea is to save the frequency(actually 0 or 1 for every number) of原创 2016-07-11 23:17:43 · 179 阅读 · 0 评论 -
HDU 2795 Billboard
Thinking: There are 2 tips for this problem. (1) If we use struct , TLE may appear. Instead, I changed to use array maxl[] to store the largest space left in a row in this interval. (2) Since n <=原创 2016-07-12 12:22:23 · 248 阅读 · 0 评论 -
POJ 2828 Buy Tickets
Thinking: About this question, we have to think reversely. We first get all the input and arrange the sequence from the last guy who enters the queue. Because the last guy will not be effected by p原创 2016-07-16 15:22:27 · 304 阅读 · 0 评论