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

26191번 - Differences 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB153594741.228%

문제

We have a list of $N$ strings $S_i$. All strings have length $M$ and consist only of characters A, B, C and D. Let us define the distance between two strings $X$ and $Y$ as the number of indices $j,ドル where the strings have different characters ($X_j \neq Y_j$). We know that the list of strings $S_i$ contains precisely one special string that has distance $K$ to all other strings. Note that there might be other pairs of strings with a distance of $K$. We are experiencing problems finding this special string, so please write a program to help us out.

입력

The first line contains space-separated integers $N,ドル $M$ and $K$. Strings $S_i$ are given in the following $N$ lines.

출력

Output the index $i$ of the special string. Strings are numbered from 1ドル$ to $N$ as given in the input.

제한

  • 2ドル \leq N, M \leq 10^5$
  • 1ドル \leq K \leq M$
  • $ N M \leq 2 \cdot 10^7$

예제 입력 1

5 10 2
DCDDDCCADA
ACADDCCADA
DBADDCCBDC
DBADDCCADA
ABADDCCADC

예제 출력 1

4

예제 입력 2

4 6 5
AABAAA
BAABBB
ABAAAA
ABBAAB

예제 출력 2

2

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2022 F번

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

출처

대학교 대회

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

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