分块
向阳花木0829
搬去博客园啦,https://www.cnblogs.com/0xiaoyu/
展开
-
Group(分块+莫队)
There are n men ,every man has an ID(1…n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand in line. Now we select an interval of men to make ...原创 2020-05-17 17:17:51 · 199 阅读 · 0 评论 -
An Average Game(分块+莫队)
Alice and Bob has just learned how to find average of some numbers. They got really excited and decided to come up with a game about finding average. The game works like this, at the start of game a s...原创 2019-08-03 15:15:25 · 166 阅读 · 0 评论 -
Color the ball(分块)
N个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数ab(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗? Input 每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a,b(1 ...原创 2019-08-01 17:19:16 · 141 阅读 · 0 评论 -
Super Mario(分块)
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 20:35:46 · 165 阅读 · 0 评论