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],…
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 Problem's Link: http://acm.timus.ru/problem.aspx?space=1&num=1960 Mean: 给你一个长度为n的字符串S,输出S的各个前缀中回文串的数量. analyse: 回文树(回文自动机)的模板题. 由于回文自动机中的p是一个计数器,也相当于一个指针,记录的是当前插入字符C后回文树中有多少个节点. 那么我们只需要一路插,一路输出p-2就行. p-2是因为一开始回文树中就有两个…
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…
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 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 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…
[转]python类中super()和__init__()的区别 单继承时super()和__init__()实现的功能是类似的 class Base(object): def __init__(self): print 'Base create' class childA(Base): def __init__(self): print 'creat A ', Base.__init__(self) class childB(Base): def __init__(self): print '…
[Aizu2292]Common Palindromes(回文树) 题面 Vjudge 神TMD日语 翻译: 给定两个字符串\(S,T\),询问\((i,j,k,l)\)这样的四元组个数 满足\(S[i,j],T[k,l]\)都是回文串并且\(S[i,j]=T[k,l]\) 题解 自己\(yy\)一下就会做了 回文树又叫做回文自动机,所以当然可以用来进行回文串的识别和匹配了 对于一个串构建\(PAM\)或者说回文树,统计一下每个回文串的出现次数 再用另外一个串在\(PAM\)上进行匹配,计算一下…