2012年7月5日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 #define MAXN 2200 6 #define MAXM 12 7 char s[MAXN],t[MAXN]; 8 int wa[MAXN],wb[MAXN],wv[MAXN],ws[MAXN]; 9 int sa[MAXN],rk[MAXN],height[MAXN]; 10 int st[MAXN][MAXM]; 11 inline bool cmp(int *r,int a, 阅读全文
posted @ 2012-07-05 21:44 DrunBee 阅读(344) 评论(0) 推荐(0) 编辑
  2012年7月4日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 typedef long long LL; 4 #define MAXN 50010 5 char s[MAXN]; 6 int wa[MAXN],wb[MAXN],wv[MAXN],ws[MAXN]; 7 int sa[MAXN],height[MAXN],Rank[MAXN]; 8 inline bool cmp(int *r,int a,int b,int len) 9 {10 return r[a]==r[b]&&r[a+len]==r[b+len];11 }12 阅读全文
posted @ 2012-07-04 21:13 DrunBee 阅读(506) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 #define MAXN 20010 5 int in[MAXN],a[MAXN]; 6 int ws[MAXN],wv[MAXN],wa[MAXN],wb[MAXN]; 7 int sa[MAXN],Rank[MAXN],height[MAXN]; 8 int n,k; 9 inline bool cmp(int *r,int a,int b,int len)10 {11 return r[a]==r[b]&&r[a+le 阅读全文
posted @ 2012-07-04 20:27 DrunBee 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<algorithm> 3 #define INF 0x7FFFFFFF 4 #define MAXN 20010 5 using namespace std; 6 int a[MAXN]; 7 int wa[MAXN],wb[MAXN],sa[MAXN],wv[MAXN],ws[MAXN]; 8 int height[MAXN],Rank[MAXN]; 9 inline bool cmp(int *r,int a,int b,int len)10 {11 return r[a]==r[b]&&r 阅读全文
posted @ 2012-07-04 18:34 DrunBee 阅读(389) 评论(0) 推荐(1) 编辑
  2012年7月3日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define MAXN 200010 5 using namespace std; 6 char s[MAXN]; 7 int sa[MAXN],wa[MAXN],wb[MAXN],wv[MAXN],ws[MAXN]; 8 int Rank[MAXN],height[MAXN]; 9 inline bool cmp(int *r,int a,int b,int len)10 {11 return r[a]==r[b]&&am 阅读全文
posted @ 2012-07-03 00:16 DrunBee 阅读(433) 评论(0) 推荐(0) 编辑
  2012年6月30日
摘要: 1、单点更新。【HDU】1166 敌兵布阵【HDU】1754 I Hate It【POJ】3264 Balanced Lineup【HDU】3074 Multiply game【POJ】2352 Stars【HDU】1394 Minimum Inversion Number【HDU】2795 Billboard【HDU】4046 Panda【POJ】2828 Buy Tickets【ZOJ】3279 Ants【FOJ】1962 新击鼓传花游戏【FOJ】1921 栀子花开【Codeforces】159C String Manipulation 1.0【POJ】2886 Who Gets the 阅读全文
posted @ 2012-06-30 20:20 DrunBee 阅读(1565) 评论(1) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #define INF 0x7FFFFFFF 3 #define MAXN 1000010 4 struct node 5 { 6 int cnt,son[4],kind[4]; 7 int big,small,sum,add,cover; 8 }; 9 node tree[MAXN<<2]; 10 int size,SUM,BIG,SMALL; 11 inline int MAX(int x,int y) 12 { 13 return x>y?x:y; 14 } 15 inline int MIN(int ... 阅读全文
posted @ 2012-06-30 09:59 DrunBee 阅读(854) 评论(0) 推荐(0) 编辑
  2012年6月28日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 1010 4 int ans,n,tree[MAXN<<2][MAXN<<2]; 5 void SubBuild(int t,int L,int R,int rt) 6 { 7 tree[t][rt]=0; 8 if(L!=R) 9 { 10 int mid=(L+R)>>1; 11 SubBuild(t,L,mid,rt<<1); 12 SubBuild(t,mid+1,R,rt<<1|1); ... 阅读全文
posted @ 2012-06-28 20:39 DrunBee 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #define MAXN 300 3 struct node 4 { 5 int big[MAXN<<2],small[MAXN<<2]; 6 }; 7 node tree[MAXN<<2]; 8 int n,b; 9 inline int MAX(int x,int y) 10 { 11 return x>y?x:y; 12 } 13 inline int MIN(int x,int y) 14 { 15 return x>y?y:x; 16 } 17 void SubBuild(int t 阅读全文
posted @ 2012-06-28 11:48 DrunBee 阅读(345) 评论(0) 推荐(0) 编辑
  2012年6月27日
摘要: 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 #define MAXN 110 5 #define MAXM 1010 6 struct node 7 { 8 int big[MAXM<<2]; 9 }; 10 node tree[MAXN<<2]; 11 inline int MAX(int x,int y) 12 { 13 return x>y?x:y; 14 } 15 void SubBuild(int t,int L,int R,int rt) 1 阅读全文
posted @ 2012-06-27 22:47 DrunBee 阅读(381) 评论(0) 推荐(0) 编辑