12209 | 2024-12-09 12:53:20 | Csongi | Számjegycsere | python3 | Wrong answer 21/100 | 527ms | 3560 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] == '0' and (('5' in n) or bnull):
print("1")
elif n[-1] == '5' and (('2' in n) or ('7' in n)):
print("1")
elif n[-2] in "27" 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 | 16ms | 3128 KiB | ||||
subtask2 | 21/21 | ||||||
2 | Accepted | 172ms | 3128 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 507ms | 3396 KiB | ||||
4 | Accepted | 505ms | 3388 KiB | ||||
5 | Accepted | 527ms | 3384 KiB | ||||
6 | Accepted | 504ms | 3364 KiB | ||||
7 | Accepted | 493ms | 3380 KiB | ||||
8 | Accepted | 497ms | 3312 KiB | ||||
9 | Accepted | 504ms | 3432 KiB | ||||
10 | Accepted | 500ms | 3392 KiB | ||||
11 | Accepted | 504ms | 3384 KiB | ||||
12 | Accepted | 504ms | 3452 KiB | ||||
13 | Accepted | 495ms | 3384 KiB | ||||
14 | Accepted | 503ms | 3444 KiB | ||||
15 | Accepted | 514ms | 3384 KiB | ||||
16 | Accepted | 527ms | 3384 KiB | ||||
17 | Accepted | 512ms | 3384 KiB | ||||
18 | Accepted | 507ms | 3388 KiB | ||||
19 | Accepted | 501ms | 3384 KiB | ||||
20 | Accepted | 517ms | 3440 KiB | ||||
21 | Accepted | 517ms | 3252 KiB | ||||
22 | Accepted | 500ms | 3336 KiB | ||||
23 | Accepted | 493ms | 3384 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 16ms | 3128 KiB | ||||
25 | Accepted | 17ms | 3124 KiB | ||||
26 | Accepted | 17ms | 3120 KiB | ||||
27 | Accepted | 16ms | 3304 KiB | ||||
28 | Accepted | 16ms | 3324 KiB | ||||
29 | Accepted | 16ms | 3136 KiB | ||||
30 | Accepted | 16ms | 3120 KiB | ||||
31 | Accepted | 16ms | 3132 KiB | ||||
32 | Accepted | 17ms | 3164 KiB | ||||
33 | Accepted | 16ms | 3136 KiB | ||||
34 | Accepted | 16ms | 3044 KiB | ||||
35 | Accepted | 16ms | 3128 KiB | ||||
36 | Accepted | 20ms | 3128 KiB | ||||
37 | Wrong answer | 28ms | 3188 KiB | ||||
38 | Accepted | 17ms | 3128 KiB | ||||
39 | Accepted | 16ms | 3432 KiB | ||||
40 | Accepted | 16ms | 3204 KiB | ||||
41 | Accepted | 16ms | 3140 KiB | ||||
42 | Accepted | 21ms | 3172 KiB | ||||
43 | Accepted | 19ms | 3176 KiB | ||||
44 | Accepted | 20ms | 3040 KiB | ||||
45 | Accepted | 20ms | 2988 KiB | ||||
46 | Accepted | 17ms | 2992 KiB | ||||
47 | Accepted | 19ms | 3184 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Accepted | 25ms | 3324 KiB | ||||
49 | Accepted | 20ms | 3560 KiB | ||||
50 | Accepted | 517ms | 3384 KiB | ||||
51 | Accepted | 20ms | 3048 KiB | ||||
52 | Wrong answer | 118ms | 3192 KiB | ||||
53 | Accepted | 17ms | 3128 KiB | ||||
54 | Accepted | 21ms | 3184 KiB | ||||
55 | Accepted | 72ms | 3188 KiB | ||||
56 | Accepted | 513ms | 3460 KiB | ||||
57 | Accepted | 19ms | 3508 KiB | ||||
58 | Accepted | 17ms | 3560 KiB | ||||
59 | Accepted | 17ms | 3528 KiB | ||||
60 | Accepted | 23ms | 3128 KiB | ||||
61 | Accepted | 23ms | 3016 KiB | ||||
62 | Accepted | 23ms | 3132 KiB | ||||
63 | Accepted | 23ms | 3128 KiB | ||||
64 | Accepted | 521ms | 3384 KiB | ||||
65 | Accepted | 513ms | 3444 KiB | ||||
66 | Accepted | 495ms | 3384 KiB |