线段树
Lyang0.0
这个作者很懒,什么都没留下…
展开
-
C - Super Mario(分块3)
Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. We regard the road to...原创 2019-08-01 21:07:07 · 147 阅读 · 0 评论 -
B - Argestes and Sequence(分块2)
Argestes has a lot of hobbies and likes solving query problems especially. One day Argestes came up with such a problem. You are given a sequence a consisting of N nonnegative integers, a[1],a[2],...,...原创 2019-08-01 20:03:28 · 144 阅读 · 0 评论 -
A - Color the ball(线段树分块1 || 树状数组)
N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数...原创 2019-08-01 17:08:25 · 125 阅读 · 0 评论 -
C - A Simple Problem with Integers(线段树区间更新)
You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the ...原创 2019-07-30 12:37:26 · 99 阅读 · 0 评论 -
Sasha and Array (线段树 + 快速幂)
Sasha has an array of integersa1, a2, ..., an. You have to performmqueries. There might be queries of two types:1 l r x— increase all integers on the segment fromltorby valuesx; 2 l r— fi...原创 2019-02-21 17:28:18 · 266 阅读 · 2 评论 -
C - Zhenya moves from parents (线段树 + lazy标记)
Zhenya moved from his parents’ home to study in other city. He didn’t take any cash with him, he only took his father’s credit card with zero balance on it. Zhenya succeeds in studies at the Universit...原创 2019-08-09 16:07:21 · 161 阅读 · 0 评论 -
O - Snacks(DFS序2)
百度科技园内有nn个零食机,零食机之间通过n−1n−1条路相互连通。每个零食机都有一个值vv,表示为小度熊提供零食的价值。由于零食被频繁的消耗和补充,零食机的价值vv会时常发生变化。小度熊只能从编号为0的零食机出发,并且每个零食机至多经过一次。另外,小度熊会对某个零食机的零食有所偏爱,要求路线上必须有那个零食机。为小度熊规划一个路线,使得路线上的价值总和最大。Input输入数据第...原创 2019-08-10 09:08:05 · 209 阅读 · 0 评论