线段树
HonniLin
double fighting
展开
-
HDU 1698-I Hate It (线段树,点修改)
线段树原创 2014-07-27 21:58:52 · 482 阅读 · 0 评论 -
HDU 4638 - Group(树状数组 / 线段树)
#题目:http://acm.hdu.edu.cn/showproblem.php?pid=4638#题意:给出n(1#思路:题目转化:要使得和最大,应该尽可能的使得连续id的分成一组, 所以就变成了一个区间中连续id的区间.树状数组.初始化时记录a[i] 在数组中的位置pos[a[i]] = i.从左到右扫描,当前为a[i], 先假设a[i]不与前面的任何原创 2015-03-31 20:41:00 · 467 阅读 · 0 评论 -
POJ 2528-Mayor's posters(线段树区间更新+离散化)
DescriptionThe 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 counci原创 2014-08-15 14:51:56 · 750 阅读 · 0 评论 -
FZU2105-Digits Count(线段树区间)
DescriptionGiven N integers A={A[0],A[1],...,A[N-1]}. Here we have some operations:Operation 1: AND opn L RHere opn, L and R are integers.For L≤i≤R, we do A[i]=A[i] AND opn (here "AND" is bi原创 2014-08-11 02:20:30 · 628 阅读 · 0 评论 -
CF 242E-XOR on Segment(线段树区间处理+二进制)
DescriptionYou've got an array a, consisting of n integers a1, a2, ..., an. You are allowed to perform two operations on this array:Calculate the sum of current array elements on the segment原创 2014-08-08 22:45:47 · 923 阅读 · 0 评论 -
POJ3468-A Simple Problem with Integers(线段树 成段更新求和)
思路:线段树成段更新,区间求和。CODE:原创 2014-08-01 10:39:54 · 552 阅读 · 0 评论 -
UVA 11992- Fast Matrix Operations(线段树区间各种操作)
DescriptionProblem FFast Matrix OperationsThere is a matrix containing at most 106 elements divided into r rows and c columns. Each element has a location (x,y) where 11 x1 y1 x2 y2 vI原创 2014-08-06 20:19:16 · 725 阅读 · 0 评论 -
ZOJ 3686-A Simple Tree Problem (DFS+线段树)
DescriptionGiven a rooted tree, each node has a boolean (0 or 1) labeled on it. Initially, all the labels are 0.We define this kind of operation: given a subtree, negate all its labels.And we原创 2014-08-04 16:22:31 · 719 阅读 · 0 评论 -
POJ 1166-敌兵布阵 (线段树裸题)
Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。原创 2014-07-26 00:49:49 · 1160 阅读 · 1 评论 -
HDU 1698-Just a Hook(线段树 成段更新)
思路:线段树,成段更新,求总和原创 2014-08-01 10:45:41 · 627 阅读 · 0 评论 -
HDU 2795-Billboard (单点更新,成段查询)
思路 :线段树,单点更新,成段查询。原创 2014-08-01 10:32:12 · 574 阅读 · 0 评论 -
SYSU 14546 - Excellent Engineers(线段树‘单点更新)
题目:http://soj.sysu.edu.cn/show_problem.php?pid=14546&cid=题意:n(1~1e5)个人,每个人有三个属性值a,b,c,求出 不存在有人的所有的属性都比其高的人的个数。思路:将数按照属性a排序,边查询(1,num[i].b)区间属性c的最小值,边更新(1,num[i].b)区间属性c的最小值。由于是边查询边更新,保证了原创 2015-05-23 17:28:54 · 635 阅读 · 0 评论