摘要: View Code 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 using namespace std; 5 int n,m; 6 char s[1000010],p[10010]; 7 int next[11111]; 8 void get_next() 9 {10 next[0]=-1;11 for(int i=1,j=-1;i<m;i++){12 while(j>=0&&p[j+1]!=p[i]) j=next[j];13 if(p[j+1]== 阅读全文
posted @ 2012-03-20 18:33 静静的等待_93 阅读(117) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 using namespace std; 5 int a[10001],cnt; 6 bool cmp(int a,int b){ 7 return a<b; 8 } 9 int sch(int u)10 {11 int low=0,high=cnt-1,mid;12 if(u<=a[low]) return low;13 else if(u>=a[high]) return high;14 w 阅读全文
posted @ 2012-03-20 16:01 静静的等待_93 阅读(119) 评论(0) 推荐(0) 编辑