
字符串_后缀自动机
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
SPOJ1812 LCS2(SAM)
2012-11-26 20:30882人阅读评论(15)收藏举报 转载请注明出处,谢谢http://blog.youkuaiyun.com/ACM_cxlove?viewmode=contents by---cxlove 题目:求多个串的LCS http://www.spoj.pl/problems/LCS2/ 先将一个串建SAM,然后用后面的串去匹配,对于每一个串,保存最大值,原创 2013-11-08 20:25:40 · 1007 阅读 · 0 评论 -
POJ1509--Glass Beads
Description Once upon a time there was a famous actress. As you may expect, she played mostly Antique Comedies most of all. All the people loved her. But she was not interested in the crowds. Her big原创 2013-11-06 20:00:36 · 778 阅读 · 0 评论 -
SPOJ 1811 LCS(后缀自动机)
http://www.spoj.com/problems/LCS/ 题意:求两个字符串A,B的最长公共子串。字符串长度不超过250000。 思路:这应该算是后缀自动机的经典应用了吧,我们先构造A的SAM,然后用A的SAM一次读入B的每一个字符,初始时状态在root处,此时最大匹配数为tmp=0,(这里的最大匹配数是指以当前读入的字符结尾,往前能匹配的最大长度),设当前到达的状态为p,最大匹原创 2013-11-08 20:14:12 · 692 阅读 · 0 评论 -
SPOJ 8222 Substrings(SAM)
转载请注明出处,谢谢http://blog.youkuaiyun.com/ACM_cxlove?viewmode=contents by---cxlove 题意:给一个字符串S,令F(x)表示S的所有长度为x的子串中,出现次数的最大值。求F(1)..F(Length(S)) (感谢clj的翻译>_ http://www.spoj.pl/problems/NSUBSTR/ 建立 SA原创 2013-11-07 17:15:14 · 835 阅读 · 0 评论 -
SPOJ7258--SUBLEX(SAM)
转载请注明出处,谢谢http://blog.youkuaiyun.com/ACM_cxlove?viewmode=contents by---cxlove 题目:给出一个串,查询字典序排在第k个的是哪个子串 http://www.spoj.pl/problems/SUBLEX/ 由于SAM能遍历所有的子串,只要预处理出某个结点的后继中有多少个不同的子串就可以了。原创 2013-11-08 20:01:39 · 814 阅读 · 0 评论 -
HDU4622--Reincarnation
Problem Description Now you are back,and have a task to do: Given you a string s consist of lower-case English letters only,denote f(s) as the number of distinct sub-string of s. And you have some原创 2013-11-08 18:48:24 · 1124 阅读 · 0 评论