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

15865번 - Genetics 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB125343134.066%

문제

For villains that intend to take over the world, a common way to avoid getting caught is to clone themselves. You have managed to catch an evil villain and her N−1 clones, and you are now trying to figure out which one of them is the real villain.

To your aid you have each person’s DNA sequence, consisting of M characters, each being either A, C, G or T. You also know that the clones are not perfectly made; rather, their sequences differ in exactly K places compared to the real villain’s.

Can you identify the real villain?

입력

The first line contains the three integers N, M, and K, where 1≤K≤M. The following N lines represent the DNA sequences. Each of these lines consists of M characters, each of which is either A, C, G or T.

In the input, there is exactly one sequence that differs from all the other sequences in exactly K places.

Warning: this problem has rather large amounts of input, and will require fast IO in Java.

출력

Output an integer – the index of the DNA sequence that belongs to the villain. The sequences are numbered starting from 1.

제한

서브태스크 1 (27점)

  • 3 ≤ N, M ≤ 100

서브태스크 2 (19점)

  • 3 ≤ N, M ≤ 1800
  • All characters are either A or C.

서브태스크 3 (28점)

  • 3 ≤ N, M ≤ 4100
  • All characters are either A or C.

서브태스크 4 (26점)

  • 3 ≤ N, M ≤ 4100

예제 입력 1

4 3 1
ACC
CCA
ACA
AAA

예제 출력 1

3

예제 입력 2

4 4 3
CATT
CAAA
ATGA
TCTA

예제 출력 2

4

힌트

출처

Olympiad > Baltic Olympiad in Informatics > BOI 2018 2B번

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

출처

대학교 대회

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

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