摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1754线段树,单点更新 1 #include <stdio.h> 2 3 #define lson l, m, root<<1 4 #define rson m+1, r, root<<1|1 5 6 const int maxn = 200010; 7 const int minint = 1<<31; 8 int max1[maxn<<2]; 9 10 int max(int x, int y)11 {12 return x>y? x: y 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1166线段树,单点更新 1 #include <stdio.h> 2 3 #define lson l, m, root<<1 4 #define rson m+1, r, root<<1|1 5 6 const int maxn = 55555; 7 8 int sum[maxn<<2]; 9 10 void push_up(int root)11 {12 sum[root] = sum[root<<1] + sum[root<<1|1 阅读全文