版本比较
SAM后缀自动机
正文
增加 5 行删除 5 行
46 行未改动47484950515253545556678 行未改动全部展开735736737738739740741742743268 行未改动全部展开101210131014101510161017101810191020151 行未改动全部展开11721173117411751176117711781179118073 行未改动46 行未改动| 睡睡觉 | | 回教室 | 被吵醒 | | || 摸摸鱼 | | | | 回家 | |表格中左侧第一列为当前状态。表格中上方第一行为切换的下一个状态。表格中每行从左到右为状态切换的条件(状态 A 能不能切换到状态B)。举例:678 行未改动全部展开cin >> s;for (auto c : s) {sam.extend(c - '0');}sam.extend(2);}for (int i = 1; i <= n; i++) {string s;268 行未改动全部展开if(pre[i][now]&&len[pre[i][now]]>=slen) now=pre[i][now];}ans=max(ans,1ll*cnt[now]*(r-l+1));}}sam;void manacher(){p[++m]='@';151 行未改动全部展开for(int i=1; i<=tot; ++i) c[len[i]]++;for(int i=0; i<=mxl; ++i) c[i]=0;for(int i=1; i<=tot; ++i) c[len[i]]++;for(int i=1; i<=mxl; ++i) c[i]+=c[i-1];for(int i=1; i<=tot; ++i) id[c[len[i]]--]=i;}void solve(){for(int i=1;i<=tot;i++){73 行未改动46 行未改动47484950515253545556678 行未改动全部展开735736737738739740741742743268 行未改动全部展开101210131014101510161017101810191020151 行未改动全部展开11721173117411751176117711781179118073 行未改动46 行未改动| 睡睡觉 | | 回教室 | 被吵醒 | | || 摸摸鱼 | | | | 回家 | |表格中左侧第一列为当前状态。表格中上方第一行为切换的下一个状态。表格中每行从左到右为状态切换的条件(状态 A 能不能切换到状态B)。举例:678 行未改动全部展开cin >> s;for (auto c : s) {sam.extend(c - '0');}sam.extend(2);}for (int i = 1; i <= n; i++) {string s;268 行未改动全部展开if(pre[i][now]&&len[pre[i][now]]>=slen) now=pre[i][now];}ans=max(ans,1ll*cnt[now]*(r-l+1));}}sam;void manacher(){p[++m]='@';151 行未改动全部展开for(int i=1; i<=tot; ++i) c[len[i]]++;for(int i=0; i<=mxl; ++i) c[i]=0;for(int i=1; i<=tot; ++i) c[len[i]]++;for(int i=1; i<=mxl; ++i) c[i]+=c[i-1];for(int i=1; i<=tot; ++i) id[c[len[i]]--]=i;}void solve(){for(int i=1;i<=tot;i++){73 行未改动