QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#770885 | #7951. Magic Cards | vwxyz | TL | 39ms | 10764kb | Python3 | 427b | 2024-11-22 01:12:01 | 2024-11-22 01:12:01 |
Judging History
answer
from collections import defaultdict
N,K,M,F=map(int,input().split())
A=[set(map(int,input().split())) for k in range(K)]
dct=defaultdict(list)
for n in range(1,N+1):
S=""
for k in range(K):
if n in A[k]:
S+="Y"
else:
S+="N"
dct[S].append(n)
for f in range(F):
S=input()
if len(dct[S])==1:
ans=dct[S][0]
else:
ans=0
print(ans)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 15ms
memory: 10704kb
input:
12 4 6 3 1 9 7 11 3 5 2 10 3 6 7 11 4 5 6 7 6 12 8 11 10 9 12 9 YYNY NNNY YNNN
output:
11 8 1
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 15ms
memory: 10644kb
input:
13 4 6 4 1 9 7 11 3 5 2 10 3 6 7 11 4 5 6 7 6 12 8 11 10 9 12 9 YYNY NNNY YNNN NNNN
output:
11 8 1 13
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 9ms
memory: 10708kb
input:
14 4 6 4 1 9 7 11 3 5 2 10 3 6 7 11 4 5 6 7 6 12 8 11 10 9 12 9 YYNY NNNY YNNN NNNN
output:
11 8 1 0
result:
ok 4 lines
Test #4:
score: 0
Accepted
time: 10ms
memory: 10652kb
input:
1 1 1 1 1 Y
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 16ms
memory: 10724kb
input:
1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 39ms
memory: 10764kb
input:
1 100 5000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
1
result:
ok single line: '1'
Test #7:
score: 0
Accepted
time: 8ms
memory: 10620kb
input:
2 1 1 2 1 Y N
output:
1 2
result:
ok 2 lines
Test #8:
score: 0
Accepted
time: 13ms
memory: 10712kb
input:
2 2 1 2 1 2 YN NY
output:
1 2
result:
ok 2 lines
Test #9:
score: 0
Accepted
time: 12ms
memory: 10648kb
input:
3 2 1 3 1 2 YN NY NN
output:
1 2 3
result:
ok 3 lines
Test #10:
score: 0
Accepted
time: 2ms
memory: 10628kb
input:
3 3 1 3 1 2 3 YNN NYN NNY
output:
1 2 3
result:
ok 3 lines
Test #11:
score: 0
Accepted
time: 10ms
memory: 10588kb
input:
4 3 1 4 1 2 3 YNN NYN NNY NNN
output:
1 2 3 4
result:
ok 4 lines
Test #12:
score: 0
Accepted
time: 11ms
memory: 10720kb
input:
10 10 1 2 1 1 1 1 1 1 1 1 1 1 YYYYYYYYYY NNNNNNNNNN
output:
1 0
result:
ok 2 lines
Test #13:
score: 0
Accepted
time: 19ms
memory: 10628kb
input:
100 100 1 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
result:
ok 100 lines
Test #14:
score: 0
Accepted
time: 12ms
memory: 10624kb
input:
101 100 1 101 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
result:
ok 101 lines
Test #15:
score: -100
Time Limit Exceeded
input:
500000 100 5000 50000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...