二分+单调队列优化dp+后缀自动机 //CTSC2012 熟悉的文章 #include <bits/stdc++.h> using namespace std; const int maxn = 1e7; #define ll long long char s[maxn]; struct node { int fa; int v; int ch[2]; }t[maxn]; int n,m; int siz = 1; int rt = 1; int lst = 1; inline void ex…