回文树/回文自动机
永夜莫明
菜是原罪
展开
-
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 · 193 阅读 · 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 · 266 阅读 · 0 评论 -
Palindromes and Super Abilities (回文树-本质不同的回文串的种数)
https://cn.vjudge.net/contest/314885#problem/B After 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 · 253 阅读 · 0 评论 -
CA Loves Palindromic (回文树-区间本质不同的回文串的种数)
https://cn.vjudge.net/contest/314885#problem/C CA 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 · 399 阅读 · 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 · 386 阅读 · 0 评论