随笔分类 - 字符串
摘要:显然要是没有限制那就全都是$1$对吧, 所以考虑这些$0, 1$到底限制了啥。 首先看到$border$, 容易想到当年写$kmp$求最短回文子串的那题。因为$kmp$的$next$数组实际上就是最长$border$。我们也在那题积累一个结论, 就是对于原来的串一个长度为$k$的$border$,
阅读全文
摘要:struct PAM { int ch[N][26], fail[N], len[N]; int tot, las; PAM() { len[0] = 0; len[1] = -1; fail[0] = 1; tot = 1; las = 0; } inline int gtfail(int x,
阅读全文
摘要:#include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define R register #define LL long long const int inf = 0x3f3f3f3f; con
阅读全文