110962024-07-06 22:52:55probaSzámjegycserepython3Wrong answer 0/10018ms3320 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))
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms3044 KiB
subtask20/21
2Wrong answer17ms3044 KiB
subtask30/23
3Wrong answer17ms3232 KiB
4Wrong answer17ms3088 KiB
5Wrong answer17ms3044 KiB
6Wrong answer17ms3080 KiB
7Wrong answer17ms2940 KiB
8Wrong answer18ms3192 KiB
9Wrong answer17ms3180 KiB
10Wrong answer17ms3180 KiB
11Wrong answer18ms3200 KiB
12Wrong answer18ms3088 KiB
13Wrong answer17ms3064 KiB
14Wrong answer17ms3316 KiB
15Wrong answer17ms2972 KiB
16Wrong answer18ms3088 KiB
17Wrong answer18ms3044 KiB
18Wrong answer17ms2900 KiB
19Wrong answer17ms3192 KiB
20Wrong answer18ms3044 KiB
21Wrong answer17ms3044 KiB
22Wrong answer17ms3320 KiB
23Wrong answer17ms3064 KiB
subtask40/41
24Wrong answer18ms3108 KiB
25Wrong answer17ms2972 KiB
26Wrong answer18ms3320 KiB
27Wrong answer17ms3076 KiB
28Wrong answer17ms2972 KiB
29Wrong answer17ms3044 KiB
30Wrong answer17ms3184 KiB
31Wrong answer17ms3044 KiB
32Wrong answer17ms3064 KiB
33Wrong answer17ms2916 KiB
34Wrong answer18ms3088 KiB
35Wrong answer17ms3044 KiB
36Wrong answer17ms3196 KiB
37Wrong answer18ms2904 KiB
38Wrong answer17ms3044 KiB
39Wrong answer17ms3044 KiB
40Wrong answer17ms3192 KiB
41Wrong answer17ms2888 KiB
42Wrong answer17ms3068 KiB
43Wrong answer17ms3044 KiB
44Wrong answer17ms2916 KiB
45Wrong answer17ms3192 KiB
46Wrong answer18ms3204 KiB
47Wrong answer17ms3192 KiB
subtask50/15
48Wrong answer17ms3088 KiB
49Wrong answer17ms3108 KiB
50Wrong answer17ms3088 KiB
51Wrong answer17ms3192 KiB
52Wrong answer18ms2960 KiB
53Wrong answer17ms2916 KiB
54Wrong answer17ms3044 KiB
55Wrong answer17ms3044 KiB
56Wrong answer17ms3064 KiB
57Wrong answer17ms3192 KiB
58Wrong answer18ms3212 KiB
59Wrong answer18ms3320 KiB
60Wrong answer17ms3088 KiB
61Wrong answer17ms3076 KiB
62Wrong answer17ms2992 KiB
63Wrong answer17ms3044 KiB
64Wrong answer17ms3192 KiB
65Wrong answer17ms3060 KiB
66Wrong answer17ms3044 KiB