시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
0.5 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
An astrobiologist studies life on the planet Alphabet. Life here is DNA-based and there are 26 nucleotides. Consequently, the DNA of a life form from Alphabet can be represented as a string of lowercase letters of the Latin alphabet. The astrobiologist has sequenced the DNA of K life forms, not necessarily distinct, with a total length of N nucleotides. Now she would like to find strands (substrings) of DNA that occur frequently among these life forms. Let L(i) be the length of the longest strand of consecutive DNA nucleotides common to at least i life forms, for 2 ≤ i ≤ K. Note that L(i) can be 0.
Help the astrobiologist compute the array L.
The input contains an integer number on the first line, K, representing the number of life forms. Each of the following K lines contains a non-empty string of lowercase letters, terminated by a newline character.
The output must contain K - 1 lines with the values L(2), L(3), ..., L(K), each on its own line.
번호 | 배점 | 제한 |
---|---|---|
1 | 30 | N ≤ 10,000 |
2 | 40 | N ≤ 100,000 |
3 | 30 | none |
6 matter animate pattern thermal domain teammate
5 3 2 2 1