线段树
文章平均质量分 79
u011123263
这个作者很懒,什么都没留下…
展开
-
Just a Hook
Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the sa原创 2013-11-17 22:29:34 · 647 阅读 · 0 评论 -
Sequence operation
Problem Description lxhgww got a sequence contains n characters which are all '0's or '1's. We have five operations here: Change operations: 0 a b change all characters into '0's in [a , b] 1 a原创 2013-11-19 23:11:52 · 670 阅读 · 0 评论 -
LCIS
Problem Description Given n integers. You have two operations: U A B: replace the Ath number by B. (index counting from 0) Q A B: output the length of the longest consecutive increasing subseque原创 2013-11-25 22:14:50 · 408 阅读 · 0 评论 -
防守阵地 II
Problem Description 部队中总共有N个士兵,每个士兵有各自的能力指数Xi,在一次演练中,指挥部确定了M个需要防守的地点,指挥部将选择M个士兵依次进入指定地点进行防守任务,获得的参考指数即为M个士兵的能力之和。随着时间的推移,指挥部将下达Q个指令来替换M个进行防守的士兵们,每个参加完防守任务的士兵由于疲惫等原因能力指数将下降1。现在士兵们排成一排,请你计算出每次进行防守的士兵原创 2014-05-02 19:48:41 · 450 阅读 · 0 评论 -
区间求最值
Problem description 给定一个长度为N 的数组,有q个询问,每个询问是求在数组的一段区间内那个元素的因子的个数最大,比如24的因子的个数就是8。 Input 首先是一个整数t,表示有t组测试数据,每组测试数据的第一行是一个整数N(1i(1ii,ri(lii,li>=1,rii+1>=li,ri+1>=ri。 Output原创 2014-06-11 22:26:11 · 698 阅读 · 2 评论 -
RMQ with Shifts
Problem Description In the traditional RMQ (Range Minimum Query) problem, we have a static array A. Then for each query (L, R) (L In this problem, the array A is no longer static: we need to suppo原创 2014-04-09 16:51:01 · 483 阅读 · 0 评论