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

21839번 - Mutant Vaccine 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB96141216.667%

문제

Dr. Icey Peacie is working on a vaccine for Covid-19. One difficulty with vaccines is that viruses mutate, so there are many different strains circulating. Dr. Peacie wants the vaccine to target a part of the genetic sequence of the virus that all the strains have in common. Can you find the longest piece of RNA that occurs in all of the strains?

입력

The first line of input contains an integer N, the number of strains of the virus, with 1 ≤ N ≤ 100. The next N lines each contain the genetic sequence of a strain of the virus, a string of the letters A, C, G, and T. Each string has length between 1 and 10 000.

출력

Output a single line containing the longest string that occurs as a substring of all of the strains. If there is more than one such longest string, output the one that occurs earliest in the first strain.

제한

예제 입력 1

3
GACCAT
CACAT
ACCA

예제 출력 1

AC

예제 입력 2

4
ACG
ACGT
ACGT
TTTT

예제 출력 2

예제 입력 3

2
AGGAGAAG
GAAGAGGA

예제 출력 3

AGGA

힌트

출처

Contest > Waterloo's local Programming Contests > 6 February, 2021 A번

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

출처

대학교 대회

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

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