2 人解决,6 人已尝试。
2 份提交通过,共有 12 份提交。
9.4 EMB 奖励。
单点时限: 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.
3 abcb bca acbc
2
2 人解决,6 人已尝试。
2 份提交通过,共有 12 份提交。
9.4 EMB 奖励。