当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6208:The Dominator of Strings

题目描述
Here you have a set of strings. A dominator is a string of the set dominating all strings else. The string $S$ is dominated by $T$ if $S$ is a substring of $T$.
输入解释
The input contains several test cases and the first line provides the total number of cases.
For each test case, the first line contains an integer $N$ indicating the size of the set.
Each of the following $N$ lines describes a string of the set in lowercase.
The total length of strings in each case has the limit of $100000$.
The limit is 30MB for the input file.
输出解释
For each test case, output a dominator if exist, or No if not.
输入样例
3
10
you
better
worse
richer
poorer
sickness
health
death
faithfulness
youbemyweddedwifebetterworsericherpoorersicknesshealthtilldeathdouspartandpledgeyoumyfaithfulness
5
abc
cde
abcde
abcde
bcde
3
aaaaa
aaaab
aaaac
输出样例
youbemyweddedwifebetterworsericherpoorersicknesshealthtilldeathdouspartandpledgeyoumyfaithfulness
abcde
No
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6208

最后修改于 2020-10-25T23:29:20+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/3000MS(Java/Others) 65535/32768K(Java/Others)