随笔分类 -  字符串:KMP

【POJ3080】Blue Jeans
摘要:这道题我们发现每个串的长度只有60 所以对于第一个串(或者选一个你喜欢的)枚举子串分别与其他串KMP匹配 注意长度相等时字典序最小&&长度<3时 no significant commonalities 1 #include<cstdio> 2 #include<cstring> 3 using n 阅读全文
posted @ 2016-10-06 11:31 Absolutezero 阅读(241) 评论(0) 推荐(0)
【HDU1686】Oulipo
摘要:KMP模板题 1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int pre[1000010],m[1000010]; 5 char p[1000010],q[1000010]; 6 int KMP(int l1,int 阅读全文
posted @ 2016-10-05 14:02 Absolutezero 阅读(139) 评论(0) 推荐(0)