2012年5月22日
摘要: 1 #include<cstdio> 2 typedef __int64 LL; 3 #define MAXN 50010 4 #define MOD 1000000007 5 LL tree[MAXN<<2]; 6 inline void PushUp(int rt) 7 { 8 tree[rt]=tree[rt<<1]*tree[rt<<1|1]; 9 tree[rt]%=MOD;10 }11 void Build(int L,int R,int rt)12 {13 if(L==R)14 scanf("%I64d",&am 阅读全文
posted @ 2012-05-22 19:31 DrunBee 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 32010 4 int tree[MAXN<<2],ans[MAXN]; 5 inline void PushUp(int rt) 6 { 7 tree[rt]=tree[rt<<1]+tree[rt<<1|1]; 8 } 9 void Update(int x,int L,int R,int rt)10 {11 if(L==R)12 tree[rt]++;13 else14 {15 int mid=(L+R)>>1 阅读全文
posted @ 2012-05-22 17:55 DrunBee 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 100010 4 int cnt; 5 struct node 6 { 7 int bit,val; 8 }; 9 node tree[MAXN<<2];10 inline void swap(int &x,int &y)11 {12 int temp=x;13 x=y;14 y=temp;15 }16 inline void PushUp(int rt)17 {18 tree[rt].bit=tree[rt<<1].bit 阅读全文
posted @ 2012-05-22 17:29 DrunBee 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 8010 4 int tree[MAXN<<2],color[MAXN],ans[MAXN]; 5 inline void PushDown(int rt) 6 { 7 if(tree[rt]!=-1) 8 { 9 tree[rt<<1]=tree[rt<<1|1]=tree[rt];10 tree[rt]=-1;11 }12 }13 void Update(int x,int y,int val,int L,int R,int 阅读全文
posted @ 2012-05-22 16:22 DrunBee 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 200010 4 char s[MAXN]; 5 int tree[26][MAXN<<2]; 6 bool vis[MAXN]; 7 inline void PushUp(int t,int rt) 8 { 9 tree[t][rt]=tree[t][rt<<1]+tree[t][rt<<1|1];10 }11 void Update(int t,int x,int L,int R,int rt)12 {13 if(L==R) 阅读全文
posted @ 2012-05-22 13:06 DrunBee 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 131080 4 #define INF 987654321 5 int lazy[MAXN<<2],cover[MAXN<<2]; 6 bool vis[MAXN<<1]; 7 inline void FXOR(int rt) 8 { 9 if(cover[rt]!=-1) 10 { 11 cover[rt]^=1; 12 lazy[rt]=0; 13 } 14 else 15 lazy... 阅读全文
posted @ 2012-05-22 11:43 DrunBee 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #define MAXN 50010 5 struct node 6 { 7 int x,y; 8 }; 9 node a[MAXN],p[MAXN]; 10 int cmp(const void *a,const void *b) 11 { 12 return (*(node *)a).x-(*(node *)b).x; 13 } 14 int ans,tree[MAXN<<2]; 15 bool vis[MAXN]; 16 阅读全文
posted @ 2012-05-22 01:16 DrunBee 阅读(312) 评论(0) 推荐(1) 编辑
  2012年5月21日
摘要: 1 #include<cstdio> 2 #define MAXN 50010 3 #define INF 987654321 4 int a[MAXN<<2],b[MAXN<<2]; 5 inline int MAX(int x,int y) 6 { 7 return x>y?x:y; 8 } 9 inline int MIN(int x,int y)10 {11 return x>y?y:x;12 }13 inline void PushUp(int rt)14 {15 a[rt]=MAX(a[rt<<1],a[rt<< 阅读全文
posted @ 2012-05-21 16:32 DrunBee 阅读(281) 评论(0) 推荐(1) 编辑
摘要: 1 #include<cstdio> 2 #define MAXN 200010 3 #define INF 987654321 4 int a[MAXN],s[MAXN],tree[MAXN<<2],lazy[MAXN<<2],k; 5 inline int MAX(int x,int y) 6 { 7 return x>y?x:y; 8 } 9 inline int MIN(int x,int y) 10 { 11 return x>y?y:x; 12 } 13 inline void swap(int &x,int &y) 阅读全文
posted @ 2012-05-21 15:36 DrunBee 阅读(264) 评论(0) 推荐(1) 编辑
摘要: 1 #include<cstdio> 2 typedef __int64 LL; 3 #define MAXN 100010 4 LL 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 scanf("%I64d",&tree[ 阅读全文
posted @ 2012-05-21 14:40 DrunBee 阅读(411) 评论(0) 推荐(1) 编辑