02 2023 档案
摘要:葫芦的考验之定位子串 ###思路 后缀自动机+倍增 直接在建立的后缀树上进行查找,因为孩子和父亲一定是具有相同的后缀的,所以只需要后缀的长度足够就可以了。 ###代码 #include <bits/stdc++.h> using namespace std; const int M=2.5e5+5;
阅读全文
摘要:###双倍回文 #include <bits/stdc++.h> using namespace std; const int M=1e6+5; char s[M]; int p[M],n=1,ans=0; void Manacher(string t) { s[0]='@',s[1]='#'; f
阅读全文
摘要:电脑坏后的第一把,果然还是来找状态的。
都有点暴力出奇迹的思想吧。
阅读全文