两道差不多的题,都是回文自动机right集合处理相关. Victor and String Victor loves to play with string. He thinks a string is charming as the string is a palindromic string. Victor wants to play n times. Each time he will do one of following four operations. add a char c to…
http://www.lydsy.com/JudgeOnline/problem.php?id=3676 题意:给一个串求回文串×出现次数的最大值.(|S|<=300000) #include <bits/stdc++.h> using namespace std; const int N=300005; struct E { int f[N], c[N][26], l[N], last, s[N], n, cnt[N], tot; E() { f[0]=1; f[1]=0; l[1]=…