11964 | 2024-11-22 14:50:31 | DoberBendeguz | Számjegycsere | pypy3 | Wrong answer 0/100 | 442ms | 27652 KiB |
N = int(input())
m = -1
for i in range(N):
K = input()
if K[-2:] in ['00','25','50','75']:
m = 0
elif K[-2:] in ['52','05','57']:
m = 1
elif K[-1] == '5' and ('2' in K or '7' in K[:-1]):
m = 1
elif K[-1] == '0' and ('5' in K or '0' in K[:-1]):
m = 1
elif '2' in K and '5' in K:
m = 2
elif '5' in K and '7' in K:
m = 2
elif K.count('0') > 1:
m = 2
elif '5' in K and '0' in K:
m = 2
else:
m = -1
print(m)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 39ms | 19440 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 256ms | 26860 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 421ms | 27360 KiB | ||||
4 | Wrong answer | 439ms | 27428 KiB | ||||
5 | Wrong answer | 365ms | 24688 KiB | ||||
6 | Wrong answer | 439ms | 26824 KiB | ||||
7 | Wrong answer | 433ms | 27372 KiB | ||||
8 | Wrong answer | 391ms | 24812 KiB | ||||
9 | Wrong answer | 439ms | 27512 KiB | ||||
10 | Wrong answer | 397ms | 25640 KiB | ||||
11 | Wrong answer | 442ms | 27372 KiB | ||||
12 | Wrong answer | 441ms | 27368 KiB | ||||
13 | Wrong answer | 425ms | 27652 KiB | ||||
14 | Wrong answer | 375ms | 24552 KiB | ||||
15 | Wrong answer | 435ms | 26700 KiB | ||||
16 | Wrong answer | 389ms | 24428 KiB | ||||
17 | Wrong answer | 398ms | 25316 KiB | ||||
18 | Wrong answer | 402ms | 24384 KiB | ||||
19 | Wrong answer | 365ms | 24556 KiB | ||||
20 | Wrong answer | 384ms | 24672 KiB | ||||
21 | Wrong answer | 372ms | 24656 KiB | ||||
22 | Wrong answer | 428ms | 26860 KiB | ||||
23 | Wrong answer | 407ms | 26860 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 39ms | 19684 KiB | ||||
25 | Accepted | 43ms | 19652 KiB | ||||
26 | Accepted | 39ms | 19440 KiB | ||||
27 | Accepted | 45ms | 19552 KiB | ||||
28 | Accepted | 45ms | 19484 KiB | ||||
29 | Accepted | 41ms | 19444 KiB | ||||
30 | Accepted | 39ms | 19692 KiB | ||||
31 | Accepted | 43ms | 19696 KiB | ||||
32 | Accepted | 41ms | 19440 KiB | ||||
33 | Wrong answer | 45ms | 19664 KiB | ||||
34 | Accepted | 39ms | 19432 KiB | ||||
35 | Accepted | 54ms | 21268 KiB | ||||
36 | Accepted | 71ms | 21484 KiB | ||||
37 | Accepted | 136ms | 22872 KiB | ||||
38 | Accepted | 46ms | 21312 KiB | ||||
39 | Accepted | 54ms | 21296 KiB | ||||
40 | Accepted | 48ms | 21436 KiB | ||||
41 | Accepted | 52ms | 21232 KiB | ||||
42 | Accepted | 71ms | 21576 KiB | ||||
43 | Accepted | 79ms | 21484 KiB | ||||
44 | Accepted | 71ms | 21544 KiB | ||||
45 | Accepted | 76ms | 21740 KiB | ||||
46 | Wrong answer | 46ms | 21380 KiB | ||||
47 | Wrong answer | 71ms | 21680 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 74ms | 21536 KiB | ||||
49 | Wrong answer | 46ms | 21756 KiB | ||||
50 | Wrong answer | 428ms | 26396 KiB | ||||
51 | Wrong answer | 61ms | 21432 KiB | ||||
52 | Wrong answer | 171ms | 23344 KiB | ||||
53 | Accepted | 52ms | 21372 KiB | ||||
54 | Accepted | 82ms | 21568 KiB | ||||
55 | Accepted | 123ms | 23788 KiB | ||||
56 | Accepted | 312ms | 23020 KiB | ||||
57 | Accepted | 46ms | 21744 KiB | ||||
58 | Accepted | 46ms | 21744 KiB | ||||
59 | Accepted | 48ms | 21744 KiB | ||||
60 | Accepted | 78ms | 21484 KiB | ||||
61 | Accepted | 75ms | 21488 KiB | ||||
62 | Accepted | 85ms | 21484 KiB | ||||
63 | Accepted | 76ms | 21600 KiB | ||||
64 | Accepted | 307ms | 23020 KiB | ||||
65 | Accepted | 310ms | 23020 KiB | ||||
66 | Accepted | 316ms | 22832 KiB |