码迷,mamicode.com
首页 >  
搜索关键字:线段树    ( 9365个结果
POJ 2299 离散化线段树
点击打开链接 Ultra-QuickSort Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 40827   Accepted: 14752 Description In this problem, you have to analyze a partic...
分类:其他好文   时间:2014-08-04 21:45:18    阅读次数:318
HDU 4893 线段树裸题
Wow! Such Sequence! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2512    Accepted Submission(s): 751 Problem Description Recently, ...
分类:其他好文   时间:2014-08-04 21:39:18    阅读次数:289
HDU 4902 Nice boat(线段树 区间更新)
Nice boat 大意:给你一个区间,每次可以进行两种操作,1:把区间中的数全都变成x  2:把区间中大于x的数变成gcd(a[i], x),最后输出序列。 思路:线段树成段更行,用num数组的叶子存储数据,节点当作lazy来使用。 #include const int maxn = 100005; int num[maxn<<2]; int gc...
分类:其他好文   时间:2014-08-04 21:34:18    阅读次数:235
HDU 1754 I Hate It (线段树 单点更新)
题目链接中文题意,与上题类似。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 const int maxn = 200000+10; 8 using namespace std; 9 int a[m...
分类:其他好文   时间:2014-08-04 21:24:28    阅读次数:275
HDU2795 Billboard 【线段树】+【单点更新】
BillboardTime Limit: 20000/8000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9632Accepted Submission(s): 4286Problem ...
分类:其他好文   时间:2014-08-04 21:11:48    阅读次数:247
HDU 1166 敌兵布阵 (线段树 单点更新)
题目链接线段树掌握的很差,打算从头从最简单的开始刷一波, 嗯。。就从这个题开始吧! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 const int maxn = 50000+10; 8 using...
分类:其他好文   时间:2014-08-04 20:49:57    阅读次数:343
POJ 2528 Mayor's posters(离散+线段树)
题目大意:往一面墙上贴与墙等高的海报,n次贴完后,求可以看见的海报总数(看见一部分也算)思路:明显的区间维护,用线段树,不过裸的线段树超时超空间,可以把坐标离散,得到不超过200000个有效点,每个点都表示一个小区间(a[i]~a[i+1]这一段),然后就可以轻松地解决了。不过题目有个坑,给定的右坐...
分类:其他好文   时间:2014-08-04 20:47:37    阅读次数:369
POJ 2886 Who Gets the Most Candies? (线段树)
Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The ...
分类:其他好文   时间:2014-08-04 17:57:27    阅读次数:284
POJ - 2991 Crane (线段树+计算几何)
Description ACM has bought a new crane (crane -- je?áb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning o...
分类:其他好文   时间:2014-08-04 17:55:37    阅读次数:240
Codeforces 57B Martian Architecture 暴力||线段树
题目链接:点击打开链接 题意:n长的序列(初始全为0) m个操作 k个查询 下面m个操作[l,r] h 代表 a[l] +=h; a[l+1] += h+i; a[l+i] += h+i;  l 然后问k个位置的和 因为k ----------------------- 如果k 只需要给区间记录一个标记lazy,表示从左端点开始 l, l+1, l+i ··· l+r 而向下更新时...
分类:其他好文   时间:2014-08-04 17:40:57    阅读次数:186
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!