11977 | 2024-11-22 15:17:18 | Xetoxino | Számjegycsere | python3 | Wrong answer 0/100 | 575ms | 3696 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 | 14ms | 3128 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 166ms | 3128 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 522ms | 3332 KiB | ||||
4 | Wrong answer | 527ms | 3380 KiB | ||||
5 | Wrong answer | 528ms | 3376 KiB | ||||
6 | Wrong answer | 523ms | 3388 KiB | ||||
7 | Wrong answer | 524ms | 3696 KiB | ||||
8 | Wrong answer | 507ms | 3384 KiB | ||||
9 | Wrong answer | 523ms | 3388 KiB | ||||
10 | Wrong answer | 510ms | 3384 KiB | ||||
11 | Wrong answer | 526ms | 3384 KiB | ||||
12 | Wrong answer | 509ms | 3384 KiB | ||||
13 | Accepted | 532ms | 3384 KiB | ||||
14 | Wrong answer | 514ms | 3328 KiB | ||||
15 | Wrong answer | 529ms | 3384 KiB | ||||
16 | Wrong answer | 508ms | 3328 KiB | ||||
17 | Wrong answer | 501ms | 3384 KiB | ||||
18 | Wrong answer | 522ms | 3384 KiB | ||||
19 | Accepted | 518ms | 3384 KiB | ||||
20 | Accepted | 508ms | 3204 KiB | ||||
21 | Wrong answer | 522ms | 3344 KiB | ||||
22 | Wrong answer | 523ms | 3384 KiB | ||||
23 | Wrong answer | 499ms | 3408 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 16ms | 3128 KiB | ||||
25 | Accepted | 16ms | 3196 KiB | ||||
26 | Accepted | 16ms | 3144 KiB | ||||
27 | Accepted | 16ms | 3128 KiB | ||||
28 | Accepted | 16ms | 3340 KiB | ||||
29 | Accepted | 17ms | 3128 KiB | ||||
30 | Accepted | 17ms | 3172 KiB | ||||
31 | Accepted | 16ms | 3176 KiB | ||||
32 | Accepted | 17ms | 3108 KiB | ||||
33 | Accepted | 16ms | 2976 KiB | ||||
34 | Accepted | 17ms | 3156 KiB | ||||
35 | Accepted | 17ms | 3200 KiB | ||||
36 | Accepted | 21ms | 3088 KiB | ||||
37 | Accepted | 54ms | 3076 KiB | ||||
38 | Accepted | 17ms | 3128 KiB | ||||
39 | Accepted | 17ms | 3128 KiB | ||||
40 | Accepted | 17ms | 3132 KiB | ||||
41 | Accepted | 17ms | 3140 KiB | ||||
42 | Accepted | 20ms | 3200 KiB | ||||
43 | Accepted | 20ms | 3060 KiB | ||||
44 | Accepted | 21ms | 3188 KiB | ||||
45 | Accepted | 20ms | 3132 KiB | ||||
46 | Accepted | 17ms | 3040 KiB | ||||
47 | Wrong answer | 20ms | 2980 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Accepted | 21ms | 3324 KiB | ||||
49 | Accepted | 17ms | 3480 KiB | ||||
50 | Wrong answer | 532ms | 3384 KiB | ||||
51 | Accepted | 17ms | 3128 KiB | ||||
52 | Wrong answer | 114ms | 3192 KiB | ||||
53 | Accepted | 17ms | 3448 KiB | ||||
54 | Accepted | 23ms | 3196 KiB | ||||
55 | Accepted | 71ms | 3236 KiB | ||||
56 | Accepted | 537ms | 3384 KiB | ||||
57 | Accepted | 17ms | 3432 KiB | ||||
58 | Accepted | 17ms | 3508 KiB | ||||
59 | Accepted | 17ms | 3564 KiB | ||||
60 | Accepted | 23ms | 3044 KiB | ||||
61 | Accepted | 23ms | 3216 KiB | ||||
62 | Accepted | 23ms | 3200 KiB | ||||
63 | Accepted | 23ms | 3128 KiB | ||||
64 | Accepted | 550ms | 3384 KiB | ||||
65 | Accepted | 541ms | 3640 KiB | ||||
66 | Accepted | 575ms | 3384 KiB |