
后缀数组
芋智波佐助
菜鸟一只
展开
-
POJ 1743 Musical Theme 后缀数组 不可重叠最长重复子串
二分长度k 长度大于等于k的分成一组 每组sa最大的和最小的距离大于k 说明可行#include #include #include using namespace std;const int maxn = 20010;int s[maxn];int sa[maxn];int t[maxn], t2[maxn], c[maxn];int rank[maxn], height[m原创 2014-12-15 17:57:33 · 914 阅读 · 0 评论 -
POJ 3882 Stammering Aliens 后缀数组height应用
题目来源:POJ 3882 Stammering Aliens题意:给你m一个一个字符串 求至少出现m次的最长字符串 可以在字符串中重叠出现思路:二分长度l 然后从height数组中找长度大于等于l的前缀 #include #include #include using namespace std;const int maxn = 40010;char s[maxn];in原创 2014-04-30 14:42:25 · 1358 阅读 · 0 评论 -
CF 427D Match & Catch 求最短唯一连续LCS
题目来源:CF 427D Match & Catch题意:给出2个字符串 求最短的连续的公共字符串 并且该字符串在原串中只出现一次思路:把2个字符串合并起来求height 后缀数组height的应用#include #include #include using namespace std;const int maxn = 100010;char s[maxn];int s原创 2014-05-03 22:47:22 · 1154 阅读 · 0 评论