11103 | 2024-07-06 23:32:49 | proba | Számjegycsere | python3 | Runtime error 0/100 | 19ms | 3324 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 = 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':
m1 = 1
else:
if m1 == 0:
m1 = 2
# ha van benne 2 nulla
if s.count('0')>1:
if s[-1]=='0' or s[-2]=='0':
m1 = 1
else:
if m1 = 0:
m1 = 2
if m1 == 0:
print(-1)
else:
print(m1)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 17ms | 3044 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Runtime error | 18ms | 3048 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Runtime error | 17ms | 3048 KiB | ||||
4 | Runtime error | 18ms | 3184 KiB | ||||
5 | Runtime error | 18ms | 3216 KiB | ||||
6 | Runtime error | 18ms | 3112 KiB | ||||
7 | Runtime error | 18ms | 3128 KiB | ||||
8 | Runtime error | 17ms | 3192 KiB | ||||
9 | Runtime error | 18ms | 3080 KiB | ||||
10 | Runtime error | 17ms | 3176 KiB | ||||
11 | Runtime error | 17ms | 3192 KiB | ||||
12 | Runtime error | 17ms | 3044 KiB | ||||
13 | Runtime error | 18ms | 3124 KiB | ||||
14 | Runtime error | 18ms | 3172 KiB | ||||
15 | Runtime error | 17ms | 2972 KiB | ||||
16 | Runtime error | 17ms | 3044 KiB | ||||
17 | Runtime error | 18ms | 3132 KiB | ||||
18 | Runtime error | 17ms | 3324 KiB | ||||
19 | Runtime error | 17ms | 3044 KiB | ||||
20 | Runtime error | 17ms | 3124 KiB | ||||
21 | Runtime error | 19ms | 3200 KiB | ||||
22 | Runtime error | 17ms | 3192 KiB | ||||
23 | Runtime error | 17ms | 3044 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Runtime error | 18ms | 3108 KiB | ||||
25 | Runtime error | 17ms | 3044 KiB | ||||
26 | Runtime error | 18ms | 3132 KiB | ||||
27 | Runtime error | 17ms | 3216 KiB | ||||
28 | Runtime error | 18ms | 3044 KiB | ||||
29 | Runtime error | 18ms | 3312 KiB | ||||
30 | Runtime error | 17ms | 3088 KiB | ||||
31 | Runtime error | 17ms | 3092 KiB | ||||
32 | Runtime error | 17ms | 3044 KiB | ||||
33 | Runtime error | 18ms | 3044 KiB | ||||
34 | Runtime error | 17ms | 3156 KiB | ||||
35 | Runtime error | 17ms | 3092 KiB | ||||
36 | Runtime error | 17ms | 3172 KiB | ||||
37 | Runtime error | 17ms | 2976 KiB | ||||
38 | Runtime error | 18ms | 3044 KiB | ||||
39 | Runtime error | 18ms | 3308 KiB | ||||
40 | Runtime error | 17ms | 3064 KiB | ||||
41 | Runtime error | 18ms | 3044 KiB | ||||
42 | Runtime error | 17ms | 3044 KiB | ||||
43 | Runtime error | 17ms | 3192 KiB | ||||
44 | Runtime error | 17ms | 3044 KiB | ||||
45 | Runtime error | 18ms | 3064 KiB | ||||
46 | Runtime error | 18ms | 3048 KiB | ||||
47 | Runtime error | 17ms | 3264 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Runtime error | 18ms | 3044 KiB | ||||
49 | Runtime error | 17ms | 3048 KiB | ||||
50 | Runtime error | 18ms | 3048 KiB | ||||
51 | Runtime error | 18ms | 3116 KiB | ||||
52 | Runtime error | 17ms | 3044 KiB | ||||
53 | Runtime error | 17ms | 2972 KiB | ||||
54 | Runtime error | 17ms | 3172 KiB | ||||
55 | Runtime error | 17ms | 3044 KiB | ||||
56 | Runtime error | 17ms | 3192 KiB | ||||
57 | Runtime error | 17ms | 2992 KiB | ||||
58 | Runtime error | 17ms | 3048 KiB | ||||
59 | Runtime error | 17ms | 3056 KiB | ||||
60 | Runtime error | 17ms | 3044 KiB | ||||
61 | Runtime error | 17ms | 3284 KiB | ||||
62 | Runtime error | 17ms | 3044 KiB | ||||
63 | Runtime error | 17ms | 3036 KiB | ||||
64 | Runtime error | 17ms | 3044 KiB | ||||
65 | Runtime error | 18ms | 2988 KiB | ||||
66 | Runtime error | 17ms | 2916 KiB |