11599 | 2024-10-29 22:44:09 | Kezdő | Számjegycsere | python3 | Runtime error 0/100 | 17ms | 3380 KiB |
T = int(input())
for i in range(T):
N = input()
v = -1
nul = N.count('0')
if len(N) >= 2:
if N[-2:] in ['00','25', '50', '75']:
v = 0
elif N[-1] == '5' and (('2' in N) or ('7' in N)):
v = 1
elif N[-1] == '0' and (('5' in N) or nul >= 2:
v = 1
elif N[-2] in '72' and '5' in N:
v = 1
elif N[-2] == '5' and '0' in N:
v = 1
elif N[-2] == '0' and ('5' in N or nul >= ):
v = 1
elif ('5' in N) and (('2' in N) or ('7' in N) or ('0' in N)):
v = 2
elif nul >= 2:
v = 2
print(v)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 16ms | 3144 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Runtime error | 14ms | 3128 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Runtime error | 16ms | 3140 KiB | ||||
4 | Runtime error | 16ms | 3116 KiB | ||||
5 | Runtime error | 16ms | 3104 KiB | ||||
6 | Runtime error | 16ms | 3128 KiB | ||||
7 | Runtime error | 16ms | 3104 KiB | ||||
8 | Runtime error | 16ms | 3128 KiB | ||||
9 | Runtime error | 14ms | 3144 KiB | ||||
10 | Runtime error | 16ms | 3128 KiB | ||||
11 | Runtime error | 16ms | 3128 KiB | ||||
12 | Runtime error | 14ms | 3124 KiB | ||||
13 | Runtime error | 16ms | 3340 KiB | ||||
14 | Runtime error | 17ms | 3128 KiB | ||||
15 | Runtime error | 16ms | 3128 KiB | ||||
16 | Runtime error | 16ms | 3380 KiB | ||||
17 | Runtime error | 14ms | 3132 KiB | ||||
18 | Runtime error | 16ms | 3128 KiB | ||||
19 | Runtime error | 17ms | 3056 KiB | ||||
20 | Runtime error | 16ms | 3320 KiB | ||||
21 | Runtime error | 16ms | 3312 KiB | ||||
22 | Runtime error | 16ms | 3120 KiB | ||||
23 | Runtime error | 16ms | 3128 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Runtime error | 16ms | 3128 KiB | ||||
25 | Runtime error | 14ms | 3128 KiB | ||||
26 | Runtime error | 16ms | 2956 KiB | ||||
27 | Runtime error | 16ms | 3012 KiB | ||||
28 | Runtime error | 16ms | 3104 KiB | ||||
29 | Runtime error | 16ms | 2984 KiB | ||||
30 | Runtime error | 14ms | 3084 KiB | ||||
31 | Runtime error | 14ms | 3024 KiB | ||||
32 | Runtime error | 16ms | 3144 KiB | ||||
33 | Runtime error | 16ms | 3132 KiB | ||||
34 | Runtime error | 16ms | 3128 KiB | ||||
35 | Runtime error | 16ms | 3120 KiB | ||||
36 | Runtime error | 17ms | 3000 KiB | ||||
37 | Runtime error | 16ms | 3152 KiB | ||||
38 | Runtime error | 16ms | 3128 KiB | ||||
39 | Runtime error | 16ms | 2976 KiB | ||||
40 | Runtime error | 16ms | 3132 KiB | ||||
41 | Runtime error | 16ms | 3064 KiB | ||||
42 | Runtime error | 16ms | 3144 KiB | ||||
43 | Runtime error | 14ms | 3332 KiB | ||||
44 | Runtime error | 16ms | 3064 KiB | ||||
45 | Runtime error | 16ms | 2996 KiB | ||||
46 | Runtime error | 16ms | 3120 KiB | ||||
47 | Runtime error | 16ms | 3072 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Runtime error | 16ms | 3140 KiB | ||||
49 | Runtime error | 14ms | 3040 KiB | ||||
50 | Runtime error | 16ms | 3088 KiB | ||||
51 | Runtime error | 16ms | 3000 KiB | ||||
52 | Runtime error | 17ms | 3072 KiB | ||||
53 | Runtime error | 16ms | 3100 KiB | ||||
54 | Runtime error | 16ms | 3156 KiB | ||||
55 | Runtime error | 16ms | 3076 KiB | ||||
56 | Runtime error | 17ms | 3128 KiB | ||||
57 | Runtime error | 16ms | 2952 KiB | ||||
58 | Runtime error | 16ms | 3116 KiB | ||||
59 | Runtime error | 14ms | 3128 KiB | ||||
60 | Runtime error | 17ms | 3128 KiB | ||||
61 | Runtime error | 17ms | 3112 KiB | ||||
62 | Runtime error | 16ms | 3128 KiB | ||||
63 | Runtime error | 16ms | 3176 KiB | ||||
64 | Runtime error | 16ms | 3128 KiB | ||||
65 | Runtime error | 16ms | 3120 KiB | ||||
66 | Runtime error | 16ms | 3144 KiB |