
后缀数组
灰黑飞
用智慧的程序写出美好的未来。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1403 后缀数组入门题
Longest Common SubstringTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4227 Accepted Submission(s): 1597Problem DescriptionGiven原创 2014-10-08 22:21:03 · 915 阅读 · 0 评论 -
POJ 3294 Life Forms (后缀数组,求出现在不少于k个字符串的最长子串)
Life FormsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 9865 Accepted: 2725DescriptionYou may have wondered why most extraterrestrial life forms resem原创 2014-10-21 14:47:39 · 428 阅读 · 0 评论 -
poj 2774 求两个字符串的最长公共子串
#include#include#include#define N 200005using namespace std;char str[N];int s[N],t1[N],t2[N],c[N],sa[N],height[N],ran[N];void build_sa(int *s,int n,int m){ int *x=t1,*y=t2,p,i,k; for(i原创 2014-10-18 17:39:39 · 404 阅读 · 0 评论 -
hdu4436 后缀数组求不同数字的和
str2intTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1436 Accepted Submission(s): 493Problem DescriptionIn this problem, you are gi原创 2014-11-01 16:48:55 · 478 阅读 · 0 评论 -
spoj 694 求不同子串的个数
SPOJ Problem Set (classical)694. Distinct SubstringsProblem code: DISUBSTRGiven a string, we need to find the total number of its distinct substrings.InputT- number of原创 2014-10-12 11:59:45 · 536 阅读 · 0 评论 -
求最长可重叠重复子串
问题描述给定一个字符串,求出其可重叠最长重复子串例如:abcdabcd最长重复子串是 abcd,最长重复子串可以重叠例如:abcdabcda,这时最长重复子串是 abcda,中间的 a 是被重叠的。直观的解法是,首先检测长度为 n - 1 的字符串情况,如果不存在重复则检测 n - 2, 一直递减下去,直到 1 。这种方法的时间复杂度是 O(N * N * N),其中包括三原创 2014-10-11 10:23:13 · 759 阅读 · 0 评论 -
poj 3261(后缀数组,求可重叠的k次最长重复子串)
Milk PatternsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 10514 Accepted: 4723Case Time Limit: 2000MSDescriptionFarmer John has noticed that th原创 2014-10-11 11:41:07 · 433 阅读 · 0 评论 -
ural 1297. Palindrome后缀数组求最长回文子串
1297. PalindromeTime limit: 1.0 secondMemory limit: 64 MBThe “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Un原创 2014-10-12 18:00:49 · 543 阅读 · 0 评论 -
spoj 705
和spoj 694几乎一样,就是数组开大点就行啦。#include#include#includeusing namespace std;#define N 50005int x[N],s[N],sa[N],rank[N],height[N],c[N],t1[N],t2[N];void build_sa(int *s,int n,int m){ int *x=t1,*y=t2,原创 2014-10-12 12:08:30 · 454 阅读 · 0 评论 -
tyvj 1860 后缀数组入门题
描述 Description我们定义一个字符串的后缀suffix(i)表示从s[i]到s[length(s)]这段子串。后缀数组(Suffix array)SA[i]中存放着一个排列,满足suffix(sa[i])定义height[i]表示suffix(sa[i])与suffix(sa[i-1])之间的最长公共前缀长度,其中height[1]=0你的任务就是求出SA和heigh原创 2014-10-10 10:44:48 · 454 阅读 · 0 评论 -
poj 1743 后缀数组求最长不重叠重复子串
Musical ThemeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 19089 Accepted: 6545DescriptionA musical melody is represented as a sequence of N (1<=N<=20原创 2014-10-10 20:07:08 · 660 阅读 · 0 评论 -
hdu 4691 后缀数组
Front compressionTime Limit: 5000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 1386 Accepted Submission(s): 519Problem DescriptionFront compression原创 2014-11-06 16:39:59 · 445 阅读 · 0 评论