SDUT OJ 2463 学密码学一定得学程序

2015-01-27 09:58:22 · 作者: · 浏览: 8
\
#include
  
   
#include
   
     #include
    
      #define N 10010 #define M 1000100 using namespace std; int next[N]; char s[M],t[N]; void getnext(char s[]) { int i=0,j=-1,len; next[0]=-1; len=strlen(s); while(i
     
=len1) return i-len1+1; else return 0; } int main() { int n; cin>>n; while(n--) { cin>>s>>t; getnext(t); int m=KMP(s,t); if(m) cout< _<::"<