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
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
KMP 我似乎复杂度写的不对。。。 因为位置相同只算一次,后缀数组什么的都不管用了,我们就暴力kmp,但是我写的是暴力跳。。。竟然过了。。。我写bzoj3670才发现。。。 #include<cstdio> #include<cstring> #include<algorithm> using na ...
分类:
其他好文 时间:
2017-09-05 22:02:58
阅读次数:
155
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
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2328 题意: 求 n 个串的字典序最小的最长公共子串 思路: 本题中单个字符串长度不超过 200, 可以暴力枚举一个字符串的所有前缀, 然后用kmp去匹配其他字符串. 我这里是用后缀数组写的. 类似 ...
分类:
编程语言 时间:
2017-09-02 20:02:58
阅读次数:
183
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3518 题意: 给出一个字符串, 问其中有多少字串出现了两次以上(计算次数时不能彼此覆盖, 如 "aaaa" 中 "aa" 出现了两次而非三次). 思路: 后缀数组/字典树 后缀数组解法, 题目所求即使 ...
分类:
编程语言 时间:
2017-09-01 17:47:07
阅读次数:
198
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1403 题意: 给出两个字符串, 求他们的最长公共子串 思路: 两个字符串的最长公共子串长度显然就是两个字符串的所有后缀中的最长公共前缀长度. 可以先用一个没有出现的字符(便于后面区分后缀是否属于相同字 ...
分类:
编程语言 时间:
2017-08-29 22:57:53
阅读次数:
206
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