上一页 1 ··· 16 17 18 19 20
  2012年5月21日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 100010 4 int tree[MAXN<<2],lazy[MAXN<<2]; 5 inline void PushUp(int rt) 6 { 7 tree[rt]=tree[rt<<1]+tree[rt<<1|1]; 8 } 9 void Build(int L,int R,int rt)10 {11 lazy[rt]=0;12 if(L==R)13 tree[rt]=1;14 else15 {16 int. 阅读全文
posted @ 2012-05-21 14:07 DrunBee 阅读(322) 评论(0) 推荐(1) 编辑
摘要: 1 #include<cstdio> 2 #define MAXN 200010 3 int tree[MAXN<<2],pos[MAXN],val[MAXN],ans[MAXN]; 4 void Build(int L,int R,int rt) 5 { 6 tree[rt]=R-L+1; 7 if(L!=R) 8 { 9 int mid=(L+R)>>1;10 Build(L,mid,rt<<1);11 Build(mid+1,R,rt<<1|1);12 }13 }14 int Update(int x,in... 阅读全文
posted @ 2012-05-21 13:41 DrunBee 阅读(262) 评论(0) 推荐(1) 编辑
摘要: 1 #include<cstdio> 2 #define MAXN 200010 3 #define MIN(a,b) ((a)>(b)?(b):(a)) 4 #define MAX(a,b) ((a)>(b)?(a):(b)) 5 int w,tree[MAXN<<2]; 6 inline void PushUp(int rt) 7 { 8 tree[rt]=MAX(tree[rt<<1],tree[rt<<1|1]); 9 }10 void Build(int L,int R,int rt)11 {12 if(L==R)13 tr 阅读全文
posted @ 2012-05-21 11:55 DrunBee 阅读(397) 评论(1) 推荐(1) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MIN(a,b) ((a)>(b)?(b):(a)) 4 #define MAXN 5010 5 int tree[MAXN<<2],a[MAXN]; 6 inline void PushUp(int rt) 7 { 8 tree[rt]=tree[rt<<1]+tree[rt<<1|1]; 9 }10 void Update(int x,int L,int R,int rt)11 {12 if(L==R)13 tree[rt]=1 阅读全文
posted @ 2012-05-21 11:16 DrunBee 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 50010 4 int tree[MAXN<<2]; 5 inline void PushUp(int rt) 6 { 7 tree[rt]=tree[rt<<1]+tree[rt<<1|1]; 8 } 9 void Build(int L,int R,int rt)10 {11 if(L==R)12 scanf("%d",&tree[rt]);13 else14 {15 int mid=(L+R)& 阅读全文
posted @ 2012-05-21 09:49 DrunBee 阅读(318) 评论(0) 推荐(1) 编辑
上一页 1 ··· 16 17 18 19 20