What-The-Fatherland is a strange country! All phone numbers there are strings consisting of lowercase English letters. What is double strange that a phone number can be associated with several bears! In that country there is a rock band called CF con…
题意:给你n个字符串,求出在超过一半的字符串中出现的所有子串中最长的子串,按字典序输出. 对这n个字符串建广义后缀自动机,建完后每个字符串在自动机上跑一遍,沿fail树向上更新所有子串结点的出现次数(指在n个字符串中的多少个串中出现,用siz表示),用vis数组判重,最后dfs输出结果就好了. #include<bits/stdc++.h> using namespace std; +; int n,m,ka; ][N],ss[N]; int idx(char ch) {return ch-'…