Logo
(追記) (追記ここまで)

27409번 - Frequent 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 1024 MB0000.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.

제한

  • 2 ≤ N ≤ 200,000
  • 2 ≤ K ≤ N

서브태스크

번호배점제한
130

N ≤ 10,000

240

N ≤ 100,000

330

none

예제 입력 1

6
matter
animate
pattern
thermal
domain
teammate

예제 출력 1

5
3
2
2
1

힌트

  • atter appears in two of the strings
  • mat appears in three of the strings
  • ma (or at or te) appear in four of the strings
  • ma appears in five of the strings
  • a appears in all the strings

출처

Olympiad > Romanian Master of Informatics > Romanian Master of Informatics 2016 6번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /