2018 南京區域賽 M (迴文自動機 + exkmp)

先把 s 串倒過來。c++ 而後 exkmp 搞一下,匹配每一個後綴和 t 的前綴。spa 而後用 迴文自動機求出來 以 i 這個字符結尾有多少個迴文串。code   #include<bits/stdc++.h> using namespace std; const int N = 2e6+100; char s1[N],s[N],s2[N],t[N]; int lens,lent,Next[N
相關文章
相關標籤/搜索