1337. Repetitions

单点时限: 2.0 sec

内存限制: 256 MB

A sequence of words over alphabet [‘a’,..,’z’ ] is given. The length of longest word occuring as a coherent fragment in every word given is to be found.

Task

Write a program, which:

1.reads the sequence of words,

2.counts the length of the longest word occuring as a coherent fragment in every word given,

3.writes the result.

输入格式

In the first line there is an integer n, where 1 <= n <= 5 is the number of words. In each of the next n lines there is one word formed from small letters of English alphabet [‘a’,..,’z’]. The length of each word is at least 1, but not greater than 2000.

输出格式

The out should consist of exactly one line containing a single integer equal to the length of the longest word occuring as the coherent fragment in every word given.

样例

Input
3
abcb
bca
acbc
Output
2

2 人解决,6 人已尝试。

2 份提交通过,共有 12 份提交。

9.4 EMB 奖励。

创建: 16 年,9 月前.

修改: 6 年,8 月前.

最后提交: 3 年,5 月前.

来源: POI 2000 III Stage

题目标签