11101 | 2024-07-06 23:15:16 | proba | Számjegycsere | python3 | Wrong answer 0/100 | 389ms | 7760 KiB |
# 50, 00, 25, 75
lista = [int(input()) for i in range(int(input()))]
#lista = [157, 1001, 152, 7500, 7005, 200253, 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' or s[-2]=='7' or s[-2]=='2':
m1 = 1
else:
m1 = 2
# van benne 5-ös és 0
if '0' in s and '5' in s:
if s[-2:] == '05' or s[-1]=='0' or s[-2]=='5':
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(max(x))
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 3044 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 138ms | 4800 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 301ms | 7672 KiB | ||||
4 | Wrong answer | 314ms | 7676 KiB | ||||
5 | Wrong answer | 331ms | 7620 KiB | ||||
6 | Wrong answer | 314ms | 7660 KiB | ||||
7 | Wrong answer | 307ms | 7620 KiB | ||||
8 | Wrong answer | 384ms | 7684 KiB | ||||
9 | Wrong answer | 317ms | 7664 KiB | ||||
10 | Wrong answer | 323ms | 7664 KiB | ||||
11 | Wrong answer | 312ms | 7620 KiB | ||||
12 | Wrong answer | 310ms | 7620 KiB | ||||
13 | Wrong answer | 349ms | 7668 KiB | ||||
14 | Wrong answer | 328ms | 7704 KiB | ||||
15 | Wrong answer | 310ms | 7640 KiB | ||||
16 | Wrong answer | 382ms | 7496 KiB | ||||
17 | Wrong answer | 326ms | 7588 KiB | ||||
18 | Wrong answer | 324ms | 7668 KiB | ||||
19 | Wrong answer | 354ms | 7624 KiB | ||||
20 | Wrong answer | 352ms | 7684 KiB | ||||
21 | Wrong answer | 321ms | 7660 KiB | ||||
22 | Wrong answer | 312ms | 7672 KiB | ||||
23 | Wrong answer | 314ms | 7624 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 18ms | 3336 KiB | ||||
25 | Accepted | 17ms | 3192 KiB | ||||
26 | Accepted | 17ms | 3064 KiB | ||||
27 | Accepted | 18ms | 3124 KiB | ||||
28 | Accepted | 18ms | 3108 KiB | ||||
29 | Accepted | 18ms | 3044 KiB | ||||
30 | Accepted | 17ms | 3044 KiB | ||||
31 | Accepted | 17ms | 3044 KiB | ||||
32 | Accepted | 18ms | 3044 KiB | ||||
33 | Wrong answer | 18ms | 3088 KiB | ||||
34 | Accepted | 18ms | 3240 KiB | ||||
35 | Accepted | 17ms | 3172 KiB | ||||
36 | Accepted | 19ms | 3184 KiB | ||||
37 | Accepted | 41ms | 3428 KiB | ||||
38 | Accepted | 17ms | 3048 KiB | ||||
39 | Accepted | 18ms | 3044 KiB | ||||
40 | Accepted | 17ms | 2948 KiB | ||||
41 | Accepted | 18ms | 3192 KiB | ||||
42 | Accepted | 20ms | 3172 KiB | ||||
43 | Accepted | 20ms | 3112 KiB | ||||
44 | Accepted | 20ms | 3312 KiB | ||||
45 | Accepted | 21ms | 3136 KiB | ||||
46 | Wrong answer | 18ms | 3044 KiB | ||||
47 | Wrong answer | 21ms | 3140 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 61ms | 3760 KiB | ||||
49 | Runtime error | 21ms | 3228 KiB | ||||
50 | Wrong answer | 389ms | 7524 KiB | ||||
51 | Runtime error | 17ms | 3044 KiB | ||||
52 | Wrong answer | 112ms | 4688 KiB | ||||
53 | Runtime error | 17ms | 2972 KiB | ||||
54 | Accepted | 56ms | 3832 KiB | ||||
55 | Accepted | 54ms | 4196 KiB | ||||
56 | Accepted | 275ms | 7656 KiB | ||||
57 | Runtime error | 18ms | 3452 KiB | ||||
58 | Runtime error | 17ms | 3324 KiB | ||||
59 | Runtime error | 18ms | 3300 KiB | ||||
60 | Accepted | 57ms | 3700 KiB | ||||
61 | Accepted | 56ms | 3684 KiB | ||||
62 | Accepted | 57ms | 3560 KiB | ||||
63 | Accepted | 57ms | 3684 KiB | ||||
64 | Accepted | 275ms | 7632 KiB | ||||
65 | Accepted | 268ms | 7632 KiB | ||||
66 | Accepted | 272ms | 7760 KiB |