manacher魔改,hash+二分都好写,但是我魔改了个回文自动机就写自闭了orz 根本上来说只要把==改成!=即可,但是这样一来很多停止条件就没了,需要很多特判手动刹车,最后统计一下size即可 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=500005; int n,ch[N][2],fa[N],dis[N],si[N],con=1,la…
http://www.lydsy.com/JudgeOnline/problem.php?id=2084 题意:一个01串,求满足字符串0和1取反后,再将整个串反过来和原串一样的子串数目.(n<=500000) #include <bits/stdc++.h> using namespace std; const int N=500005; long long ans; int len[N<<1], n; char s[N<<1]; int main() { sc…