摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3518后缀数组View Code 1 //3518 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 int Max(int x,int y) {return x>y?x:y;} 7 int Min(int x,int y) {return x<y?x:y;} 8 const int L=1010; 9 char str[L];10 int r[L],wa[L],wb[L],ws[L];1
阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1892二维树状数组View Code 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 const int N=1010,maxn=1001; 6 int a[N][N],c[N][N]; 7 int lowbit(int x) 8 { 9 return x&(-x);10 }11 void add(int x,int px,int py,int maxn)12 {13 for(int i=p
阅读全文