Palindromes and Super Abilities 2 题目链接: http://acm.hust.edu.cn/vjudge/contest/126823#problem/E Description Dima adds letters s 1, -, s n one by one to the end of a word. After each letter, he asks Misha to tell him how many new palindrome substrings…
2040. Palindromes and Super Abilities 2 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=2040 Description Dima adds letters s1, -, sn one by one to the end of a word. After each letter, he asks Misha to tell him how many new palindrome substrings a…
 Palindromes and Super Abilities Problem's Link: http://acm.timus.ru/problem.aspx?space=1&num=1960 Mean: 给你一个长度为n的字符串S,输出S的各个前缀中回文串的数量. analyse: 回文树(回文自动机)的模板题. 由于回文自动机中的p是一个计数器,也相当于一个指针,记录的是当前插入字符C后回文树中有多少个节点. 那么我们只需要一路插,一路输出p-2就行. p-2是因为一开始回文树中就有两个…
Palindromes and Super Abilities 2 Time Limit: 1MS   Memory Limit: 102400KB   64bit IO Format: %I64d & %I64u Status Description Dima adds letters s1, -, sn one by one to the end of a word. After each letter, he asks Misha to tell him how many new pali…
Palindromes and Super Abilities Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on Ural. Original ID: 196064-bit integer IO format: %lld      Java class name: (Any) After solving seven problems on Timus Online Judge with a word “…
Palindromes and Super Abilities 2Time Limit: 500MS Memory Limit: 102400KB 64bit IO Format: %I64d & %I64u Description Dima adds letters s1, …, sn one by one to the end of a word. After each letter, he asks Misha to tell him how many new palindrome sub…
Dima adds letters s1, …, sn one by one to the end of a word. After each letter, he asks Misha to tell him how many new palindrome substrings appeared when he added that letter. Two substrings are considered distinct if they are different as strings.…
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 word, he can mentally count the number of unique nonempty substrings of this word that are palindr…
http://acm.timus.ru/problem.aspx?space=1&num=1960 题意:给一个串s,要求输出所有的s[0]~s[i],i<|s|的回文串数目.(|s|<=10^5) #include <bits/stdc++.h> using namespace std; struct PT { static const int nS=26, nL=100015, N=nL; int f[N], l[N], c[N][nS], id[N], s[nL],…
Bryce1010模板 http://acm.timus.ru/problem.aspx?space=1&num=1960 #include <bits/stdc++.h> using namespace std; const int maxn = 100010; struct PalindromicTree{ int fail[maxn],len[maxn],son[maxn][26]; int tot,last,n; char s[maxn]; int newnode(int sl…