
线段树
YRZ-James
who say you are not perfect?
展开
-
HDU - 1394 Minimum Inversion Number
题目:The inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers a1, a2, …, an, if we move the fi...原创 2019-04-15 19:00:16 · 137 阅读 · 0 评论 -
ZOJ - 1610 Count the Colors
题目:Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.I...原创 2019-04-17 15:55:46 · 175 阅读 · 0 评论 -
POJ - 2777 Count Color
题目:Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There is a very long board with length L centimeter, L...原创 2019-04-14 17:17:36 · 156 阅读 · 0 评论 -
POJ - 2528 Mayor's posters
题目:The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has final...原创 2019-04-16 21:48:14 · 178 阅读 · 0 评论 -
HDU - 1698 Just a Hook
题目: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 same length.Now Pud...原创 2019-04-13 16:58:01 · 115 阅读 · 0 评论 -
POJ - 3468 A Simple Problem with Integers
题目:You have N integers, 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 th...原创 2019-04-13 16:03:58 · 122 阅读 · 0 评论 -
HDU - 1754 I Hate It
题目:很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<50...原创 2019-04-13 13:32:19 · 254 阅读 · 2 评论 -
HDU - 1166 敌兵布阵
题目:C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战...原创 2019-04-12 22:48:18 · 162 阅读 · 0 评论 -
HDU - 2795
题目:At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are posted: neare...原创 2019-04-15 21:11:09 · 140 阅读 · 0 评论 -
HDU - 1556 Color the ball
题目:N个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a...原创 2019-04-17 19:06:35 · 176 阅读 · 0 评论