随笔分类 -  初级数据结构

摘要:#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= 阅读全文
posted @ 2020-10-23 20:42 林生。 阅读(45) 评论(0) 推荐(0)
摘要: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= 阅读全文
posted @ 2020-10-23 20:41 林生。 阅读(113) 评论(0) 推荐(0)