
后缀自动机 【Suffix Automaton】
zlttttt
这个作者很懒,什么都没留下…
展开
-
[BZOJ3473]字符串-后缀自动机
字符串Description给定n个字符串,询问每个字符串有多少子串(不包括空串)是所有n个字符串中至少k个字符串的子串?Input第一行两个整数n,k。 接下来n行每行一个字符串。Output一行n个整数,第i个整数表示第i个字符串的答案。Sample Input3 1 abc a abSample Output6 1 3HINT对于 100% 的数据,1<=n,k<=10^5,所有字符串原创 2018-02-02 15:29:12 · 361 阅读 · 0 评论 -
[LOJ6031][雅礼集训2017Day1]字符串-后缀自动机-莫队算法-倍增LCA
字符串Description令 ss 与 ww 为两字符串,定义:w[l,r]w[l,r] 表示字符串 ww 在区间 [l,r][l,r] 中的子串; ww 在 ss 中出现的频率定义为ww在ss中出现的次数; f(s,w,l,r)f(s,w,l,r) 表示 w[l,r]w[l,r] 在 ss 中出现的频率。 比如 f(ababa,aba,1,3)=2。f(ababa,aba,1,3)=2。现原创 2017-12-06 00:44:56 · 1341 阅读 · 0 评论 -
[BZOJ3676][Apio2014]回文串-后缀自动机+Manacher | | 回文树
[Apio2014]回文串Description考虑一个只包含小写拉丁字母的字符串s。我们定义s的一个子串t的“出 现值”为t在s中的出现次数乘以t的长度。请你求出s的所有回文子串中的最 大出现值。Input输入只有一行,为一个只包含小写字母(a -z)的非空字符串s。Output输出一个整数,为逝查回文子串的最大出现值。Sample Input【样例输入l】 abacaba 【样例输入2]原创 2017-04-08 14:28:00 · 392 阅读 · 0 评论 -
[BZOJ3926][Zjoi2015]诸神眷顾的幻想乡-后缀自动机
3926: [Zjoi2015]诸神眷顾的幻想乡Description幽香是全幻想乡里最受人欢迎的萌妹子,这天,是幽香的2600岁生日,无数幽香的粉丝到了幽香家门前的太阳花田上来为幽香庆祝生日。 粉丝们非常热情,自发组织表演了一系列节目给幽香看。幽香当然也非常高兴啦。 这时幽香发现了一件非常有趣的事情,太阳花田有n块空地。在过去,幽香为了方便,在这n块空地之间修建了n-1条边将...原创 2017-04-03 19:14:35 · 506 阅读 · 2 评论 -
[SPOJ1812]LCS2 - Longest Common Substring II-后缀自动机
LCS2 - Longest Common Substring IIDescriptionA string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set of lowercase letters.Substring, also called factor, is原创 2017-04-05 00:41:58 · 437 阅读 · 0 评论 -
[SPOJ8222]NSUBSTR - Substrings-后缀自动机
NSUBSTR - SubstringsDescriptionYou are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some string with length x appears in原创 2017-04-05 01:00:40 · 408 阅读 · 0 评论 -
[SPOJ1811]Longest Common Substring-后缀自动机
Longest Common SubstringDescriptionA string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set of lowercase letters.Substring, also called factor, is a consecu原创 2017-04-03 19:25:21 · 349 阅读 · 0 评论 -
[HDU4622]Reincarnation-后缀自动机
ReincarnationProblem DescriptionNow 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原创 2017-04-03 19:23:47 · 289 阅读 · 0 评论 -
[BZOJ1396]识别子串-后缀树
识别子串DescriptionInput一行,一个由小写字母组成的字符串S,长度不超过10^5OutputL行,每行一个整数,第i行的数据表示关于S的第i个元素的最短识别子串有多长.Sample InputagoodcookcooksgoodfoodSample Output1 2 3 3 2 2 3 3 2 2 3原创 2018-02-02 09:35:46 · 330 阅读 · 0 评论