摘要: 解法: 对于第二个串,循环移动能得到的字典序最小的串,可以直接用最小表示法搞定。 然后用最小表示的第二个串和第一个串做两次扩展KMP,一次正常求,另外一次将两个串都反转一下,然后扫一遍ex[]数组 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int N = (int)2e6+10; 6 char a[N],b[N],c[N]; 7 int next[N],exa[N],exb[N]; 8 void getnext(cha 阅读全文
posted @ 2013-06-17 21:03 silver__bullet 阅读(365) 评论(0) 推荐(0) 编辑