Manacher(马拉车)
#include<iostream> #include<string.h> #include<algorithm> #include <cstdio> using namespace std; const int N = 1e7 + 1e6 + 100; char s[N]; char s_new[N * 2]; int p[N * 2]; int Init() { int len = strlen(s); s_new[0] = '$'; s_new[1] = '#'; int j = 2; for (int i = 0; i < len; i++) { s_new[j++] = s[i]; s_new[j++] = '#'; } s_new[j] = '