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

21178번 - Basic Basis 다국어

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

문제

You are given a sequence of $n$ bit strings $b_1, b_2, \dots , b_n,ドル each with $k \times 4$ bits.

You are also given another sequence of $m$ bit strings $a_1, a_2, \dots , a_m,ドル each also with $k \times 4$ bits.

Let $f(x)$ denote the minimum index $i$ such that it is possible to take a non-empty subset of $b_1, b_2, \dots , b_i$ , XOR them all together, and get $x$. If there is no such index, $f(x) = -1$.

Print the values $f\left(a_1\right), f\left(a_2\right), \dots , f\left(a_m\right)$.

입력

The first line of input contains three integers $n$ (1ドル \le n \le 1,000$), $m$ (1ドル \le m \le 1,000$) and $k$ (1ドル \le k \le 40$), where $n$ is the length of sequence $b,ドル $m$ is the length of sequence $a,ドル and the elements of both sequences are bit strings with $k \times 4$ bits.

Each of the next $n$ lines contains a hexadecimal representation of $b_i$ as a string of length $k$. The strings consist only of hexadecimal digits (‘0’–‘9’ and ‘a’–‘f’).

Then, each of the next $m$ lines contains a hexadecimal representation of $a_i$ in the same format as above.

출력

Output $m$ lines with a single integer on each line, where the integer on the $i$th line is $f\left(a_i\right)$.

제한

예제 입력 1

3 5 2
02
e1
fa
02
e3
1b
e1
ff

예제 출력 1

1
2
3
2
-1

예제 입력 2

5 6 2
01
02
04
08
10
01
02
03
04
05
64

예제 출력 2

1
2
2
3
3
-1

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 1 D번

ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 2 U번

ICPC > Regionals > North America > Mid-Atlantic Regional > 2020 Mid-Atlantic USA Regional Contest J번

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

출처

대학교 대회

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

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