码迷,mamicode.com
首页 >  
搜索关键字:线段树    ( 9365个结果
2014多校5(1003)hdu4913(线段树区间操作)
Least common multiple Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 451    Accepted Submission(s): 151 Problem Description bobo...
分类:其他好文   时间:2014-08-26 09:54:35    阅读次数:198
POJ 2352 && HDU 1541 Stars (树状数组)
一开始想,总感觉是DP,可是最后什么都没想到。还暴力的交了一发。 然后开始写线段树,结果超时。感觉自己线段树的写法有问题。改天再写。先把树状数组的写法贴出来吧。 ~~~~~~~~~~~~~~~~~~~~~~~~ 树状数组不懂的去看刘汝佳的大白书,那个图画得很清楚。 题目大意:星星的坐标以y递增的顺序给出,这些点的左下方的点数代表这个点的级数,问0~N-1的级数有多少个?其实y根本木有用。 ...
分类:其他好文   时间:2014-08-26 00:29:55    阅读次数:174
HDU-4288-Coder(线段树)
Problem Description   In mathematics and computer science, an algorithm describes a set of procedures or instructions that define a procedure. The term has become increasing popular since the adven...
分类:其他好文   时间:2014-08-25 22:54:25    阅读次数:408
POJ3225Help with Intervals
开始没看懂题,看懂了之后也不知道如何用线段树来做这题,百度了一下思路 思路: 我们一个一个操作来分析:(用0和1表示是否包含区间,-1表示该区间内既有包含又有不包含) U:把区间[l,r]覆盖成1 I:把[-∞,l)(r,∞]覆盖成0 D:把区间[l,r]覆盖成0 C:把[-∞,l)(r,∞]覆盖成0 , 且[l,r]区间0/1互换 S:[l,r]区间0/1互换 还有要注意的地...
分类:其他好文   时间:2014-08-25 22:53:45    阅读次数:202
CF-85D-Sum of Medians(线段树)
In one well-known algorithm of finding the k-th order statistics we should divide all elements into groups of five consecutive elements and find the median of each five. A median is called the middl...
分类:其他好文   时间:2014-08-25 22:50:55    阅读次数:297
CodeForces 46DParking Lot线段树
和前面的hotel类似,就是多了一个前缀和后缀; #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define lson l,...
分类:其他好文   时间:2014-08-25 21:13:15    阅读次数:209
图说线段树和树状数组
图说线段树和树状数组...
分类:其他好文   时间:2014-08-25 19:23:14    阅读次数:259
OpenJudge_cdqz 数据结构版块小结
题目整理Challenge 0 随机线性存储表-easyChallenge 1链表数组-easyChallenge 2 可持久化Treap的可持久化运用-hardChallenge 3 线段树-easyChallenge 4 线段树-mediumChallenge 5 线段树加lazy标记-medi...
分类:其他好文   时间:2014-08-25 18:28:34    阅读次数:377
URAL 1019. Line Painting 线段树 区间合并 离散化
题目来源:URAL 1019. Line Painting 题意:求最长的一段全部为白色的区间 思路:线段树成段更新 区间合并 离散化 这里对应的是一段区间 所以每次不是m+1 而是 l m 和 m r 了 另外我加上了0 和 10^9 这两个点 每一段区间(l, r)我记录的是l和r之间有多少条线段 #include #include #include using namesp...
分类:其他好文   时间:2014-08-25 17:12:12    阅读次数:229
主席树
POJ 2104 这题说的是给了一个区间求区间的第K大的数, 这点利用 函数式线段树的前缀式线段是的 长处 解决, 我们将 每个数字离散一下, 然后线段树存的是他的孩子个数,然后利用函数式线段树的前缀思想 两个前缀相减便得到了我们想要的 区间中的点的个数#include #include #incl...
分类:其他好文   时间:2014-08-25 16:53:04    阅读次数:167
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!