12210 | 2024-12-09 12:55:42 | Csongi | Számjegycsere | python3 | Wrong answer 21/100 | 569ms | 3700 KiB |
t = int(input())
for x in range(t):
n = input()
bnull = n.count('0') >= 2
if len(n) >= 2:
if n[-2:] in ['00', '75', '50', '25']:
print("0")
elif n[-2:] in ['05', '52', '57']:
print("1")
elif n[-1] == '5' and (('2' in n) or ('7' in n)):
print("1")
elif n[-1] == '0' and (('5' in n) or bnull):
print("1")
elif n[-2] in '72' and '5' in n:
print("1")
elif n[-2] == '5' and '0' in n:
print("1")
elif n[-2] == '0' and bnull:
print("1")
elif ('5' in n) and (('2' in n) or ('7' in n) or ('0' in n)):
print("2")
elif bnull:
print("2")
else:
print("-1")
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 14ms | 3104 KiB | ||||
subtask2 | 21/21 | ||||||
2 | Accepted | 177ms | 3208 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 509ms | 3384 KiB | ||||
4 | Accepted | 500ms | 3240 KiB | ||||
5 | Accepted | 508ms | 3228 KiB | ||||
6 | Accepted | 510ms | 3384 KiB | ||||
7 | Accepted | 510ms | 3364 KiB | ||||
8 | Accepted | 514ms | 3336 KiB | ||||
9 | Accepted | 503ms | 3324 KiB | ||||
10 | Accepted | 509ms | 3252 KiB | ||||
11 | Accepted | 560ms | 3384 KiB | ||||
12 | Accepted | 515ms | 3460 KiB | ||||
13 | Accepted | 503ms | 3188 KiB | ||||
14 | Accepted | 509ms | 3384 KiB | ||||
15 | Accepted | 517ms | 3384 KiB | ||||
16 | Accepted | 510ms | 3384 KiB | ||||
17 | Accepted | 512ms | 3384 KiB | ||||
18 | Accepted | 569ms | 3384 KiB | ||||
19 | Accepted | 505ms | 3384 KiB | ||||
20 | Accepted | 500ms | 3384 KiB | ||||
21 | Accepted | 503ms | 3448 KiB | ||||
22 | Accepted | 495ms | 3384 KiB | ||||
23 | Accepted | 490ms | 3396 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 16ms | 3124 KiB | ||||
25 | Accepted | 17ms | 3128 KiB | ||||
26 | Accepted | 16ms | 3140 KiB | ||||
27 | Accepted | 17ms | 3128 KiB | ||||
28 | Accepted | 16ms | 3200 KiB | ||||
29 | Accepted | 14ms | 3128 KiB | ||||
30 | Accepted | 16ms | 3128 KiB | ||||
31 | Accepted | 14ms | 3128 KiB | ||||
32 | Accepted | 16ms | 3072 KiB | ||||
33 | Accepted | 16ms | 2984 KiB | ||||
34 | Accepted | 16ms | 3188 KiB | ||||
35 | Accepted | 16ms | 3040 KiB | ||||
36 | Accepted | 20ms | 3116 KiB | ||||
37 | Wrong answer | 29ms | 3136 KiB | ||||
38 | Accepted | 16ms | 3124 KiB | ||||
39 | Accepted | 16ms | 3396 KiB | ||||
40 | Accepted | 17ms | 2964 KiB | ||||
41 | Accepted | 16ms | 2964 KiB | ||||
42 | Accepted | 20ms | 2956 KiB | ||||
43 | Accepted | 20ms | 3128 KiB | ||||
44 | Accepted | 20ms | 3148 KiB | ||||
45 | Accepted | 20ms | 3124 KiB | ||||
46 | Accepted | 16ms | 3020 KiB | ||||
47 | Accepted | 20ms | 3128 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Accepted | 24ms | 3136 KiB | ||||
49 | Accepted | 19ms | 3576 KiB | ||||
50 | Accepted | 513ms | 3384 KiB | ||||
51 | Accepted | 20ms | 3144 KiB | ||||
52 | Wrong answer | 115ms | 3196 KiB | ||||
53 | Accepted | 17ms | 3128 KiB | ||||
54 | Accepted | 21ms | 3196 KiB | ||||
55 | Accepted | 68ms | 3048 KiB | ||||
56 | Accepted | 532ms | 3700 KiB | ||||
57 | Accepted | 18ms | 3560 KiB | ||||
58 | Accepted | 17ms | 3448 KiB | ||||
59 | Accepted | 17ms | 3564 KiB | ||||
60 | Accepted | 23ms | 2964 KiB | ||||
61 | Accepted | 21ms | 3188 KiB | ||||
62 | Accepted | 23ms | 3128 KiB | ||||
63 | Accepted | 21ms | 3084 KiB | ||||
64 | Accepted | 528ms | 3452 KiB | ||||
65 | Accepted | 513ms | 3448 KiB | ||||
66 | Accepted | 504ms | 3432 KiB |