PivotOJ

Genetics

시간 제한: 2000ms메모리 제한: 1024MB출처: BOI 2018BOJ 15865

문제

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

입력
4 3 1
ACC
CCA
ACA
AAA
출력
3

예제 2

입력
4 4 3
CATT
CAAA
ATGA
TCTA
출력
4
코드를 제출하려면 로그인하세요.