随笔分类 - 初级数据结构
摘要:#include<bits/stdc++.h> using namespace std; string s; int i,j,k; int main() { cin>>s; int len=s.length(); s+=s; i=0;j=1; while(i<len&&j<len) { for(k=
阅读全文
摘要:KMP 两个单整串相互匹配。 #include<bits/stdc++.h> using namespace std; const int N=1e3+5; string s1,s2; int nxt[N],ans,len1,len2; int main() { cin>>s1>>s2; len1=
阅读全文

浙公网安备 33010602011771号