码迷,mamicode.com
首页 >  
搜索关键字:后缀数组    ( 1340个结果
SPOJ Distinct Substrings(后缀数组求不同子串个数,好题)
DISUBSTR - Distinct Substrings no tags no tags Given a string, we need to find the total number of its distinct substrings. Input T- number of test ca ...
分类:编程语言   时间:2017-09-10 01:15:00    阅读次数:176
POJ 1743 Musical Theme(后缀数组+二分答案)
Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 30430 Accepted: 10183 Description A musical melody is represented as a sequen ...
分类:编程语言   时间:2017-09-09 21:39:29    阅读次数:210
bzoj3620
KMP 我似乎复杂度写的不对。。。 因为位置相同只算一次,后缀数组什么的都不管用了,我们就暴力kmp,但是我写的是暴力跳。。。竟然过了。。。我写bzoj3670才发现。。。 #include<cstdio> #include<cstring> #include<algorithm> using na ...
分类:其他好文   时间:2017-09-05 22:02:58    阅读次数:155
POJ 3581 Sequence (后缀数组+离散化)
Sequence Given a sequence, {A1, A2, ..., An} which is guaranteed A1 > A2, ..., An, you are to cut it into three sub-sequences and reverse them separat ...
分类:编程语言   时间:2017-09-05 00:25:11    阅读次数:216
后缀数组学习笔记
现在来看倍增算法是非常好理解的。 直接放一篇blog写的挺好的:http://www.cnblogs.com/zinthos/p/3899725.html 虽然理论复杂度是$O(nlogn)$,但其中各种细节优化确实十分有必要的。 给自己放一个倍增的模板,有空填DC3的坑 ...
分类:编程语言   时间:2017-09-04 19:57:18    阅读次数:127
hdu2328(后缀数组 + 二分)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2328 题意: 求 n 个串的字典序最小的最长公共子串 思路: 本题中单个字符串长度不超过 200, 可以暴力枚举一个字符串的所有前缀, 然后用kmp去匹配其他字符串. 我这里是用后缀数组写的. 类似 ...
分类:编程语言   时间:2017-09-02 20:02:58    阅读次数:183
hdu3518(后缀数组)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3518 题意: 给出一个字符串, 问其中有多少字串出现了两次以上(计算次数时不能彼此覆盖, 如 "aaaa" 中 "aa" 出现了两次而非三次). 思路: 后缀数组/字典树 后缀数组解法, 题目所求即使 ...
分类:编程语言   时间:2017-09-01 17:47:07    阅读次数:198
hdu1403(后缀数组模板)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1403 题意: 给出两个字符串, 求他们的最长公共子串 思路: 两个字符串的最长公共子串长度显然就是两个字符串的所有后缀中的最长公共前缀长度. 可以先用一个没有出现的字符(便于后面区分后缀是否属于相同字 ...
分类:编程语言   时间:2017-08-29 22:57:53    阅读次数:206
POJ 3693 Maximum repetition substring(后缀数组+RMQ)
Maximum repetition substring The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same ...
分类:编程语言   时间:2017-08-23 18:14:43    阅读次数:232
后缀数组构造
读了罗穗的论文,终于知道后缀数组怎么构造了,还反复打了五遍。 终于体会到XY的痛苦了。一篇OI生涯中最难懂的代码orz。 1 #include<cstdio> 2 #include<string.h> 3 #include<iostream> 4 using namespace std; 5 6 s ...
分类:编程语言   时间:2017-08-20 22:38:45    阅读次数:268
1340条   上一页 1 ... 42 43 44 45 46 ... 134 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!