![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
QYitong
这个作者很懒,什么都没留下…
展开
-
最好的线段树总结
线段树详解By 岩之痕目录:一:综述二:原理三:递归实现四:非递归原理五:非递归实现六:线段树解题模型七:扫描线八:可持久化 (主席树)九:练习题一:综述假设有编号从1到n的n个点,每个点都存了一些信息,用[L,R]表示下标从L到R的这些点。线段树的用处就是,对编号连续的一些点进行修改或者统计操作,修改转载 2016-11-17 00:59:12 · 17991 阅读 · 3 评论 -
Gym - 100781F Floppy Music(bitset+可行初始点)
Gym - 100781F Floppy Music(bitset+可行初始点)原创 2017-07-23 23:38:05 · 725 阅读 · 0 评论 -
Codeforces 822C - Hacker, pack your bags!(二分)
C. Hacker, pack your bags!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's well known that the best wa原创 2017-07-06 17:11:52 · 716 阅读 · 0 评论 -
CDOJ 1341 卿学姐与城堡的墙(并归排序求逆序对数)
E - 卿学姐与城堡的墙Time Limit: 2000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status卿学姐终于来到了魔王的城堡,城堡修建的十分壮观。即使心中放不下公主,卿学姐还是忍不住驻足观赏这宏伟的建筑。卿学姐注意到城原创 2017-03-13 00:27:06 · 398 阅读 · 0 评论 -
HUD1556 (树状数组解法+线段树解法)
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18680 Accepted Submission(s): 9319Problem DescriptionN个气球排成一排,从原创 2017-03-04 18:07:25 · 387 阅读 · 0 评论 -
poj 2155 Matrix (二维树状数组)
MatrixTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 26353 Accepted: 9729DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] me原创 2017-03-05 13:55:40 · 356 阅读 · 0 评论 -
Gym100507C--Zhenya moves from parents(线段树+懒标记)
Problem C. Zhenya moves from parentsTime limit: 1 secondMemory limit: 64 megabytesZhenya moved from his parents’ home to study in other city. He didn’t take any cash with him, he onlytook his原创 2017-01-31 16:39:06 · 391 阅读 · 0 评论 -
CDOJ 1325 卿学姐与基本法(离散化+线段树)
题解:看题目想到线段树,但是因为数据范围太大,显然不能直接使用线段树,所以这里应该加上离散化操作代码如下:#include #include using namespace std;const int maxn=100005;int c[2*maxn],kind[maxn],tree[8*maxn],lazy[8*maxn];int cl[maxn],cr[maxn];map原创 2017-03-12 23:50:59 · 654 阅读 · 0 评论 -
BZOJ1015 [JSOI2008]星球大战starwar——逆向思维并查集+路径压缩
1015: [JSOI2008]星球大战starwarTime Limit: 3 Sec Memory Limit: 162 MBSubmit: 5558 Solved: 2553[Submit][Status][Discuss]Description 很久以前,在一个遥远的星系,一个黑暗的帝国靠着它的超级武器统治者整个星系。某一天,凭着一个偶然的机遇,一支反抗军原创 2016-11-30 22:57:39 · 420 阅读 · 0 评论 -
Gym - 100923H Por Costel and the Match 并查集判情况矛盾 (经典)
meciul.in / meciul.outOberyn Martell and Gregor Clegane are dueling in a trial by combat. The fight is extremely important, as the life of Tyrion Lannister is on the line. Oberyn and Gregor are原创 2017-01-19 22:46:48 · 646 阅读 · 0 评论 -
CDOJ 1328 卿学姐与诡异村庄(并查集判断矛盾)
卿学姐与诡异村庄Time Limit: 4500/1500MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status日复一日,年复一年,春去秋来。卿学姐终于从天行廖那里毕业啦。出山的卿学姐首先来到了一个诡异的村庄。在这个村庄中,只有两种人,一种是好人,原创 2017-03-12 23:55:58 · 797 阅读 · 0 评论 -
BZOJ 1012之线段树解法
根据题意,很容易想到线段树,单点修改,区间查询,线段树的模板大家都有,所以就不再做过多解释。不过有一点值得一提,在我做这道题的时候使用了cin和cout,后来队友告诉我,bzoj使用了O2优化,使用cin和cout可能会报错,果然,我改了cin和cout之后就没有问题了。 #include #include using namespace std;long lon原创 2016-11-20 22:33:46 · 491 阅读 · 0 评论 -
HDU-2665 Kth number
Kth numberTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12578 Accepted Submission(s): 3831Problem DescriptionGive you a se原创 2017-09-11 13:42:49 · 412 阅读 · 0 评论