![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树,树状数组
eeetttzhangji
这个作者很懒,什么都没留下…
展开
-
树状数组维护区间最大值
C. Fountainstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputArkady plays Gardenscapes a lot. Arkady wants原创 2017-05-31 23:36:58 · 1374 阅读 · 0 评论 -
很好的一道树状数组
帅气的HYC的珍珠发布时间: 2015年11月1日 17:02 最后更新: 2015年11月2日 19:52 时间限制: 1000ms 内存限制: 128M描述 帅气的HYC经常早晨去锻炼(多么好的习惯~。有一天,他看到一路上的露珠,心里便产生了一个问题:一路上假如原创 2017-04-16 00:25:35 · 224 阅读 · 0 评论 -
线段树水题
士兵杀敌(二)时间限制:1000 ms | 内存限制:65535 KB难度:5描述南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。小工是南将军手下的军师,南将军经常想知道第m号到第n号士兵的总杀敌数,请你帮助小工来回答南将军吧。南将军的某次询问之后士兵i可能又杀敌q人,之后南将军再询问的时候,需要考虑到新增的杀敌数。原创 2017-04-15 21:29:48 · 231 阅读 · 0 评论 -
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.原创 2017-03-16 06:58:01 · 407 阅读 · 0 评论 -
A - I Hate It HDU - 1754
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0学生ID编号分别从1编到N。 第二行包含原创 2017-03-15 19:26:59 · 216 阅读 · 0 评论 -
敌兵布阵 树状数组
这是个区间求和的代码#include#include#include#includeusing namespace std;int N;int a[50010],b[50010];int lowbit(int k){ return k&(-k);}void add(int k,int num){ while(k<=N) { a[k]+=num; k原创 2017-03-13 12:31:50 · 362 阅读 · 0 评论 -
敌兵布阵 线段树
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要研究敌人究竟演习什么战术,原创 2017-03-12 21:44:46 · 264 阅读 · 0 评论 -
D - Lost Cows POJ - 2182
N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering hole' and drank a few too many beers before dinner. Wh转载 2017-03-18 18:00:20 · 277 阅读 · 0 评论 -
调了两天的BUG
A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of end原创 2017-03-17 22:03:26 · 247 阅读 · 0 评论