回文树/回文自动机
永夜莫明
菜是原罪
展开
-
string(SAM+PAM)
https://ac.nowcoder.com/acm/contest/884/I?&headNav=acm题意:求string串有多少个本质不同的子串,且这些子串之间两两不存在 a==rev(a),及不存在长度1以上的回文串题解:要算string 和 rev(string)的所有子串,对string和rev(string)建立广义后缀自动机,则理论上所有子串增加了一倍,但实际...转载 2019-07-29 00:13:24 · 197 阅读 · 2 评论 -
I Love Palindrome String(回文树+manacher)
http://acm.hdu.edu.cn/showproblem.php?pid=6599 Problem Description You are given a string S=s1s2..s|S| containing only lowercase English letters. For each integer i∈[1,|S|] , please ...原创 2019-07-27 01:01:23 · 273 阅读 · 0 评论 -
Palindromes and Super Abilities (回文树-本质不同的回文串的种数)
https://cn.vjudge.net/contest/314885#problem/BAfter solving seven problems on Timus Online Judge with a word “palindrome” in the problem name, Misha has got an unusual ability. Now, when he reads a ...原创 2019-07-27 01:15:45 · 259 阅读 · 0 评论 -
CA Loves Palindromic (回文树-区间本质不同的回文串的种数)
https://cn.vjudge.net/contest/314885#problem/CCA loves strings, especially loves the palindrome strings.One day he gets a string, he wants to know how many palindromic substrings in the substring...原创 2019-07-27 01:29:39 · 411 阅读 · 0 评论 -
回文串(回文树,每种本质不同的字符串的数目*其长度)
考虑一个只包含小写拉丁字母的字符串s。我们定义s的一个子串t的“出现值”为t在s中的出现次数乘以t的长度。请你求出s的所有回文子串中的最大出现值。Input输入只有一行,为一个只包含小写字母(a -z)的非空字符串s。Output输出一个整数,为逝查回文子串的最大出现值。Sample Input【样例输入l】 abacaba 【样例输入2] www Sam...原创 2019-07-27 01:43:59 · 399 阅读 · 0 评论