摘要: poj 1226 Substringshttp://poj.org/problem?id=1226/*题目: 查找最长子串在所有给出的字符串或者它的反转的串中出现分析: 二分枚举所有可能的长度,然后用KMP算法判断该枚举的子串是否在所有给出的字符串 或者它的翻转串中出现。*/#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int X = 205;char in[X][X],p[X];int fail[X],len[X],n,lens;int mid 阅读全文
posted @ 2012-05-30 19:43 yejinru 阅读(255) 评论(0) 推荐(0) 编辑