Substrings
来源:互联网 发布:轻而易举软件培训视频 编辑:程序博客网 时间:2024/05/19 11:47
Substrings
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 10 Accepted Submission(s) : 4
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.
Input
The first line of the input file contains a single integer t (1 <= t <= 10), the number of test cases, followed by the input data for each test case. The first line of each test case contains a single integer n (1 <= n <= 100), the number of given strings, followed by n lines, each representing one string of minimum length 1 and maximum length 100. There is no extra white space before and after a string.
Output
There should be one line per test case containing the length of the largest string found.
Sample Input
23ABCDBCDFFBRCD2roseorchid
Sample Output
22
Author
- Substrings
- Substrings
- Substrings
- Substrings
- Substrings
- Substrings
- Substrings
- POJ1226 Substrings
- HDOJ1238 Substrings
- poj1226 Substrings
- Substrings hdu
- HDU Substrings
- HDU1238 Substrings
- hdu1238 Substrings
- HDU1238:Substrings
- HDU1238 Substrings
- POJ1226--Substrings
- Good Substrings
- 如何在Linux终端里用Shell和C输出带颜色的文字
- 事件监听学习笔记
- SOJ 4021 Cocircular Points
- HDU 2242 考研路茫茫——空调教室
- 【.Net MF网络开发板研究-04】Socket编程之服务端
- Substrings
- 现在开始学C++:请教问题一
- 模板库的基本使用( 《二》 对象管理)
- 网工
- win7护眼透明主题 “魅力win7”
- 2010年五道口考研心得
- 仿函数
- 下一个项目,你会尝试用Rails吗?
- 五道口考研之谈,困惑的人好好看看