111042024-07-07 00:13:57probaSzámjegycserepython3Wrong answer 0/10018ms3320 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)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms3044 KiB
subtask20/21
2Wrong answer17ms3044 KiB
subtask30/23
3Wrong answer18ms2900 KiB
4Wrong answer17ms3088 KiB
5Wrong answer17ms3172 KiB
6Wrong answer17ms3044 KiB
7Wrong answer17ms3048 KiB
8Wrong answer18ms3088 KiB
9Wrong answer17ms3188 KiB
10Wrong answer17ms3028 KiB
11Wrong answer18ms3172 KiB
12Wrong answer17ms3044 KiB
13Wrong answer17ms3180 KiB
14Wrong answer17ms3300 KiB
15Wrong answer17ms2972 KiB
16Wrong answer18ms3104 KiB
17Wrong answer18ms2916 KiB
18Wrong answer17ms3056 KiB
19Wrong answer18ms2992 KiB
20Wrong answer18ms3084 KiB
21Wrong answer17ms2968 KiB
22Wrong answer17ms3044 KiB
23Wrong answer17ms3068 KiB
subtask40/41
24Wrong answer17ms3044 KiB
25Wrong answer17ms3104 KiB
26Wrong answer17ms3044 KiB
27Wrong answer18ms3044 KiB
28Wrong answer17ms2972 KiB
29Wrong answer17ms3044 KiB
30Wrong answer17ms3088 KiB
31Wrong answer17ms3192 KiB
32Wrong answer17ms3044 KiB
33Wrong answer17ms3044 KiB
34Wrong answer17ms3192 KiB
35Wrong answer17ms3044 KiB
36Wrong answer17ms3064 KiB
37Wrong answer18ms3048 KiB
38Wrong answer17ms3044 KiB
39Wrong answer17ms3064 KiB
40Wrong answer17ms3056 KiB
41Wrong answer18ms3028 KiB
42Wrong answer17ms3320 KiB
43Wrong answer17ms3044 KiB
44Wrong answer17ms3088 KiB
45Wrong answer17ms3044 KiB
46Wrong answer17ms3112 KiB
47Wrong answer17ms3044 KiB
subtask50/15
48Wrong answer18ms3044 KiB
49Wrong answer17ms3080 KiB
50Wrong answer17ms3116 KiB
51Wrong answer18ms3012 KiB
52Wrong answer17ms2992 KiB
53Wrong answer17ms3044 KiB
54Wrong answer17ms3068 KiB
55Wrong answer17ms2992 KiB
56Wrong answer17ms3120 KiB
57Wrong answer17ms3044 KiB
58Wrong answer17ms3192 KiB
59Wrong answer17ms3044 KiB
60Wrong answer17ms3064 KiB
61Wrong answer17ms3008 KiB
62Wrong answer17ms3064 KiB
63Wrong answer17ms2920 KiB
64Wrong answer17ms3176 KiB
65Wrong answer17ms3236 KiB
66Wrong answer17ms3044 KiB