1400 - Longest common prefix
Time Limit : 2 Second
Memory Limit : 128 MB
Given N string S, S......, S[N], you are to find a pair of strings whose longest common prefix has the largest length.
There are multiple test cases. For each case:
The first line is a integer N. (2 <= N <= 20000)
The next N lines each contains a non-empty string S[i]. The length of S[i] is at most 50.
For each case output a line representing the length of longest common prefix.
- sample input
3 bcabc bcd abcd
- sample output
- Xiaobin YANG