Problem Description
035 now faced a tough problem,his english teacher gives him a string,which consists with n lower case letter,he must figure out how many substrings appear at least twice,moreover,s...
分类:
编程语言 时间:
2015-04-09 15:34:55
阅读次数:
213
Problem Description
Given two strings, you have to tell the length of the Longest Common Substring of them.For example:
str1 = banana
str2 = cianaicSo the Longest Common Substring is “ana”, and the...
分类:
编程语言 时间:
2015-04-09 15:33:59
阅读次数:
225
DescriptionGiven a sequence, {A1, A2, …, An} which is guaranteed A1 > A2, …, An, you are to cut it into three sub-sequences and reverse them separately to form a new one which is the smallest possible...
分类:
编程语言 时间:
2015-04-08 16:28:10
阅读次数:
195
后缀数组 Orz zyf 神题不会做啊,先坑着吧……sigh 1 //BZOJ 3473 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define rep(i,n) for(int i=0;i=n;--i....
分类:
其他好文 时间:
2015-04-08 10:32:35
阅读次数:
239
You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your island. You immedietaly send for the Bytelandian Cr...
分类:
编程语言 时间:
2015-04-08 09:19:02
阅读次数:
188
Description
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given str...
分类:
编程语言 时间:
2015-04-07 21:52:51
阅读次数:
169
A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the strings = abaabaabaabais a (4,3)-repeat with t = aba as its seed...
分类:
编程语言 时间:
2015-04-07 21:48:36
阅读次数:
170
后缀数组 好感动,复习了下后缀数组居然写出来了……(感谢ykz大神) 求最长公共子串……WA了一发是因为:【不同字符串之间要用不同的特殊字符隔开】否则就会匹配到相同→_→比如都是aaa结尾,如果用相同特殊字符就会使得最长公共子串变成aaa#这样子…… 1 /******************...
分类:
其他好文 时间:
2015-04-07 21:22:28
阅读次数:
140
题目大意给出一个字符串,问这个字符串中出现过1次以上的子串的个数,按照子串的字典序输出。思路由于数据范围过小,这个题有两个解法。
基本的想法就是用后缀数组来进行后缀的排序,之后按照height数组扫就可以了。应该是挺快的。
但是注意到数据范围只有3000,因此我们只需要弄出所有的后缀拿出来建立一颗后缀Trie树就行了。最后DFS一次树种的所有节点。CODESuffixArraySuffixArr...
分类:
编程语言 时间:
2015-04-07 12:08:48
阅读次数:
201
后缀数组 当年感觉好神的题现在好像变水了…… 题意其实有点蛋疼……一开始没看懂12 #include13 #include14 #include15 #include16 #include17 #define rep(i,n) for(int i=0;i=n;--i)20 #define pb .....
分类:
Web程序 时间:
2015-04-06 23:06:25
阅读次数:
482