SPOJ LCS2 - Longest Common Substring II(SAM 求多串最长公共子串)
就是AcWing2811.多串最长公共子串改变一下输入方式即可。代码:#includeusingnamespacestd;constintN=1e5+10,M=N1&&!ch[p][s[i][j]-'a']){p=fa[p];t=len[p];}if(ch[p][s[i][j]-'a'])p=ch[p][s[i][j]-'a'],++t;now[p]=max(now[p],t);}dfs(1);f