线段树,树状数组
zhenggy_
爱生活,爱编程
展开
-
HDU 1394 Minimum Inversion Number
Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10207 Accepted Submission(s): 6274Problem Description原创 2014-07-25 10:16:44 · 495 阅读 · 0 评论 -
UVALive 4329 Ping pong
#include #include using namespace std;struct fwtree{ int C[101000], n; void init(int k){ memset(C, 0, sizeof(C)); n = k; } int lowbit(int x) { return x&-x; } void add(int x, int原创 2015-03-15 16:20:47 · 431 阅读 · 0 评论 -
POJ 3067 Japan
#include #include #include #include using namespace std;struct node{ int l, r;}a[1000*1001];bool cmp(const node &a, const node &b){ if(a.l == b.l) return a.r < b.r; re原创 2015-03-15 16:24:29 · 452 阅读 · 0 评论 -
HDU 1166 敌兵布阵 //线段树单点更新
void build(int l, int r, int n) //建树{ int mid; tree[n].l = l; tree[n].r = r; if(l==r) { tree[n].sum = h[l]; return ; } mid = (l+r)>>1; build(l, mid, 2*n); build(mid+1, r, 2*n+1); tree[n].sum = tree[2*n].sum + tree[2*n+1].sum;}原创 2014-07-23 16:59:12 · 756 阅读 · 0 评论 -
POJ 3468 A Simple Problem with Integers //线段树的成段更新
线段树的成段更新lazy操作原创 2014-07-24 11:28:08 · 855 阅读 · 0 评论 -
POJ 3264 Balanced Lineup //简单线段树
Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 33405 Accepted: 15671Case Time Limit: 2000MSDescriptionFor the daily milking, Farme原创 2014-07-23 10:55:03 · 642 阅读 · 0 评论 -
HDU 2795 Billboard //线段树简单应用
BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10074 Accepted Submission(s): 4482Problem DescriptionAt the entranc原创 2014-07-25 15:15:57 · 544 阅读 · 0 评论