11096 | 2024-07-06 22:52:55 | proba | Számjegycsere | python3 | Wrong answer 0/100 | 18ms | 3320 KiB |
# 50, 00, 25, 75
#lista = [int(input()) for i in range(int(input()))]
lista = [157, 1001, 152, 7500, 7005, 2253, 52, 22, 10011, 55, 505]
for i in lista:
# osztható 25-tel
if i % 25 == 0:
print(0)
else:
s = str(i)
m1, m2, m3 = 0, 0, 0
# van benne 5-ös továbbá 2 vagy 7-es
if '5' in s and ('2' in s or '7' in s):
if s[-1]=='5' or (s[-2:]=='57' or s[-2:]=='52') :
m1 = 1
else:
m1 = 2
# van benne 5-ös és 0
if '0' in s and '5' in s:
if s[-1] == '5' and s[-2]=='0':
m2 = 1
else:
m2 = 2
# ha van benne 2 nulla
if s.count('0')>1:
if s[-1]=='0' or s[-2]=='0':
m3 = 1
else:
m3 = 2
if m1+m2+m3 == 0:
print(-1)
else:
x = [m1, m2, m3]
while 0 in x:
x.remove(0)
print(min(x))
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 17ms | 3044 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 17ms | 3044 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 17ms | 3232 KiB | ||||
4 | Wrong answer | 17ms | 3088 KiB | ||||
5 | Wrong answer | 17ms | 3044 KiB | ||||
6 | Wrong answer | 17ms | 3080 KiB | ||||
7 | Wrong answer | 17ms | 2940 KiB | ||||
8 | Wrong answer | 18ms | 3192 KiB | ||||
9 | Wrong answer | 17ms | 3180 KiB | ||||
10 | Wrong answer | 17ms | 3180 KiB | ||||
11 | Wrong answer | 18ms | 3200 KiB | ||||
12 | Wrong answer | 18ms | 3088 KiB | ||||
13 | Wrong answer | 17ms | 3064 KiB | ||||
14 | Wrong answer | 17ms | 3316 KiB | ||||
15 | Wrong answer | 17ms | 2972 KiB | ||||
16 | Wrong answer | 18ms | 3088 KiB | ||||
17 | Wrong answer | 18ms | 3044 KiB | ||||
18 | Wrong answer | 17ms | 2900 KiB | ||||
19 | Wrong answer | 17ms | 3192 KiB | ||||
20 | Wrong answer | 18ms | 3044 KiB | ||||
21 | Wrong answer | 17ms | 3044 KiB | ||||
22 | Wrong answer | 17ms | 3320 KiB | ||||
23 | Wrong answer | 17ms | 3064 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Wrong answer | 18ms | 3108 KiB | ||||
25 | Wrong answer | 17ms | 2972 KiB | ||||
26 | Wrong answer | 18ms | 3320 KiB | ||||
27 | Wrong answer | 17ms | 3076 KiB | ||||
28 | Wrong answer | 17ms | 2972 KiB | ||||
29 | Wrong answer | 17ms | 3044 KiB | ||||
30 | Wrong answer | 17ms | 3184 KiB | ||||
31 | Wrong answer | 17ms | 3044 KiB | ||||
32 | Wrong answer | 17ms | 3064 KiB | ||||
33 | Wrong answer | 17ms | 2916 KiB | ||||
34 | Wrong answer | 18ms | 3088 KiB | ||||
35 | Wrong answer | 17ms | 3044 KiB | ||||
36 | Wrong answer | 17ms | 3196 KiB | ||||
37 | Wrong answer | 18ms | 2904 KiB | ||||
38 | Wrong answer | 17ms | 3044 KiB | ||||
39 | Wrong answer | 17ms | 3044 KiB | ||||
40 | Wrong answer | 17ms | 3192 KiB | ||||
41 | Wrong answer | 17ms | 2888 KiB | ||||
42 | Wrong answer | 17ms | 3068 KiB | ||||
43 | Wrong answer | 17ms | 3044 KiB | ||||
44 | Wrong answer | 17ms | 2916 KiB | ||||
45 | Wrong answer | 17ms | 3192 KiB | ||||
46 | Wrong answer | 18ms | 3204 KiB | ||||
47 | Wrong answer | 17ms | 3192 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 17ms | 3088 KiB | ||||
49 | Wrong answer | 17ms | 3108 KiB | ||||
50 | Wrong answer | 17ms | 3088 KiB | ||||
51 | Wrong answer | 17ms | 3192 KiB | ||||
52 | Wrong answer | 18ms | 2960 KiB | ||||
53 | Wrong answer | 17ms | 2916 KiB | ||||
54 | Wrong answer | 17ms | 3044 KiB | ||||
55 | Wrong answer | 17ms | 3044 KiB | ||||
56 | Wrong answer | 17ms | 3064 KiB | ||||
57 | Wrong answer | 17ms | 3192 KiB | ||||
58 | Wrong answer | 18ms | 3212 KiB | ||||
59 | Wrong answer | 18ms | 3320 KiB | ||||
60 | Wrong answer | 17ms | 3088 KiB | ||||
61 | Wrong answer | 17ms | 3076 KiB | ||||
62 | Wrong answer | 17ms | 2992 KiB | ||||
63 | Wrong answer | 17ms | 3044 KiB | ||||
64 | Wrong answer | 17ms | 3192 KiB | ||||
65 | Wrong answer | 17ms | 3060 KiB | ||||
66 | Wrong answer | 17ms | 3044 KiB |