11976 | 2024-11-22 15:16:47 | Xetoxino | Számjegycsere | pypy3 | Wrong answer 0/100 | 583ms | 31884 KiB |
N = int(input())
m = 0
for i in range(N):
K = input()
if len(K) >= 2:
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 K[-2] == '2' and '5' in K:
m = 1
elif K[-2] == '7' and '5' in K:
m = 1
elif K[-2] == '5' and '0' in K:
m = 1
elif K[-2] == '0' and '0' in K:
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
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 | 335ms | 28140 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 518ms | 29896 KiB | ||||
4 | Wrong answer | 523ms | 29652 KiB | ||||
5 | Wrong answer | 439ms | 27108 KiB | ||||
6 | Wrong answer | 528ms | 30068 KiB | ||||
7 | Wrong answer | 583ms | 29676 KiB | ||||
8 | Wrong answer | 465ms | 28648 KiB | ||||
9 | Wrong answer | 524ms | 29820 KiB | ||||
10 | Wrong answer | 479ms | 30524 KiB | ||||
11 | Wrong answer | 536ms | 29680 KiB | ||||
12 | Wrong answer | 522ms | 29676 KiB | ||||
13 | Accepted | 507ms | 30696 KiB | ||||
14 | Wrong answer | 439ms | 28452 KiB | ||||
15 | Wrong answer | 529ms | 30172 KiB | ||||
16 | Wrong answer | 504ms | 28572 KiB | ||||
17 | Wrong answer | 474ms | 29248 KiB | ||||
18 | Wrong answer | 483ms | 29164 KiB | ||||
19 | Accepted | 444ms | 27552 KiB | ||||
20 | Accepted | 432ms | 27628 KiB | ||||
21 | Wrong answer | 444ms | 28632 KiB | ||||
22 | Wrong answer | 521ms | 29932 KiB | ||||
23 | Wrong answer | 505ms | 29676 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 41ms | 19688 KiB | ||||
25 | Accepted | 46ms | 19624 KiB | ||||
26 | Accepted | 45ms | 19596 KiB | ||||
27 | Accepted | 41ms | 19532 KiB | ||||
28 | Accepted | 45ms | 19608 KiB | ||||
29 | Accepted | 45ms | 19736 KiB | ||||
30 | Accepted | 41ms | 19764 KiB | ||||
31 | Accepted | 41ms | 19616 KiB | ||||
32 | Accepted | 41ms | 19580 KiB | ||||
33 | Accepted | 45ms | 19688 KiB | ||||
34 | Accepted | 39ms | 19688 KiB | ||||
35 | Accepted | 52ms | 21232 KiB | ||||
36 | Accepted | 72ms | 21448 KiB | ||||
37 | Accepted | 101ms | 22980 KiB | ||||
38 | Accepted | 54ms | 21272 KiB | ||||
39 | Accepted | 56ms | 21360 KiB | ||||
40 | Accepted | 56ms | 21232 KiB | ||||
41 | Accepted | 52ms | 21260 KiB | ||||
42 | Accepted | 72ms | 21492 KiB | ||||
43 | Accepted | 72ms | 21648 KiB | ||||
44 | Accepted | 79ms | 21456 KiB | ||||
45 | Accepted | 79ms | 21600 KiB | ||||
46 | Accepted | 48ms | 21232 KiB | ||||
47 | Wrong answer | 70ms | 21464 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Accepted | 90ms | 21656 KiB | ||||
49 | Accepted | 46ms | 21740 KiB | ||||
50 | Wrong answer | 550ms | 31884 KiB | ||||
51 | Accepted | 54ms | 21572 KiB | ||||
52 | Wrong answer | 197ms | 25072 KiB | ||||
53 | Accepted | 52ms | 21484 KiB | ||||
54 | Accepted | 97ms | 21480 KiB | ||||
55 | Accepted | 138ms | 23912 KiB | ||||
56 | Accepted | 337ms | 24044 KiB | ||||
57 | Accepted | 46ms | 21868 KiB | ||||
58 | Accepted | 54ms | 21708 KiB | ||||
59 | Accepted | 48ms | 21744 KiB | ||||
60 | Accepted | 83ms | 21480 KiB | ||||
61 | Accepted | 75ms | 21484 KiB | ||||
62 | Accepted | 86ms | 21496 KiB | ||||
63 | Accepted | 75ms | 21484 KiB | ||||
64 | Accepted | 324ms | 23532 KiB | ||||
65 | Accepted | 323ms | 23512 KiB | ||||
66 | Accepted | 321ms | 23584 KiB |