摘要: 题意:给出两个串,求最长公共子串的长度。分析:将两个串合并成一个串,中间用一个没有出现过的字符连接,然后求新的串的后缀。View Code /* 后缀数组倍增算法 * 并且计算了height[], height[i] = LCP(i-1, i), LCP(i, j)=lcp(suffix(sa[i]), suffix(sa[j])) * 时间复杂度:N*logN * *///poj 2774.#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int 阅读全文
posted @ 2012-08-05 19:52 小猴子、 阅读(341) 评论(0) 推荐(0)