#P5546. [POI 2000 R3] 公共串

    ID: 4512 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>2000POI字典树,Trie 树后缀数组,SA

[POI 2000 R3] 公共串

Description

Given several words consisting of lowercase letters, find the length of their longest common substring.

Input Format

The first line of the file is an integer nn, 1n51\le n \le 5, which represents the number of words. The next nn lines each contain one word, consisting only of lowercase letters. The length of each word is at least 11 and at most 20002000.

Output Format

Only one line containing one integer: the length of the longest common substring.

3
abcb
bca
acbc
2

Hint

Translated by ChatGPT 5