110942024-07-06 22:31:03probaSzámjegycserepython3Wrong answer 0/100307ms7812 KiB
# 50, 00, 25, 75
lista = [int(input()) for i in range(int(input()))]
#lista = [1001, 152, 7500, 7005, 2235, 52, 22, 10011]

for i in lista:
    s = str(i)       
    # osztható 25-tel    
    if i % 25 == 0:
        print(0)
    else:
        tovabb = True    
        
        # 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') :
                print(1)
                tovabb = False
            else:
                print(2)
                tovabb = False
            
        # van benne 5-ös és 0
        if tovabb and '0' in s and '5' in s:
            if s[-1] == '5' and s[-2]=='0':
                print(1)
                tovabb = False
        else:
            print(2)
            tovabb = False
            
        # ha van benne 2 nulla
        if tovabb and s.count('0')>1:
            if s[-1]=='0' or s[-2]=='0':
                print(1)
                tovabb = False
            else:
                print(2)
                tovabb = False
            
        if tovabb:
            print(-1)
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms3040 KiB
subtask20/21
2Wrong answer114ms4928 KiB
subtask30/23
3Wrong answer256ms7620 KiB
4Wrong answer259ms7620 KiB
5Wrong answer272ms7812 KiB
6Wrong answer261ms7684 KiB
7Wrong answer256ms7620 KiB
8Wrong answer298ms7792 KiB
9Wrong answer261ms7664 KiB
10Wrong answer264ms7624 KiB
11Wrong answer266ms7628 KiB
12Wrong answer259ms7748 KiB
13Wrong answer263ms7668 KiB
14Wrong answer264ms7668 KiB
15Wrong answer259ms7624 KiB
16Wrong answer303ms7752 KiB
17Wrong answer273ms7624 KiB
18Wrong answer277ms7620 KiB
19Wrong answer270ms7752 KiB
20Wrong answer270ms7684 KiB
21Wrong answer268ms7684 KiB
22Wrong answer261ms7624 KiB
23Wrong answer263ms7624 KiB
subtask40/41
24Wrong answer18ms3116 KiB
25Wrong answer18ms3084 KiB
26Wrong answer18ms3192 KiB
27Wrong answer18ms2952 KiB
28Wrong answer18ms3044 KiB
29Wrong answer18ms3044 KiB
30Wrong answer17ms3320 KiB
31Wrong answer17ms3184 KiB
32Wrong answer18ms3044 KiB
33Wrong answer17ms3044 KiB
34Wrong answer17ms3044 KiB
35Wrong answer17ms3044 KiB
36Wrong answer20ms3192 KiB
37Wrong answer39ms3696 KiB
38Wrong answer17ms3044 KiB
39Wrong answer17ms3192 KiB
40Wrong answer18ms3064 KiB
41Wrong answer17ms3044 KiB
42Wrong answer19ms3192 KiB
43Wrong answer19ms3252 KiB
44Wrong answer20ms3172 KiB
45Wrong answer20ms3192 KiB
46Wrong answer17ms3188 KiB
47Wrong answer20ms3180 KiB
subtask50/15
48Wrong answer56ms3740 KiB
49Runtime error17ms3260 KiB
50Wrong answer307ms7676 KiB
51Runtime error17ms3044 KiB
52Wrong answer92ms4680 KiB
53Runtime error17ms3064 KiB
54Wrong answer56ms3556 KiB
55Wrong answer52ms4324 KiB
56Wrong answer243ms7620 KiB
57Runtime error18ms3236 KiB
58Runtime error17ms3300 KiB
59Runtime error18ms3172 KiB
60Wrong answer54ms3684 KiB
61Wrong answer56ms3552 KiB
62Wrong answer56ms3684 KiB
63Wrong answer56ms3684 KiB
64Wrong answer246ms7516 KiB
65Wrong answer244ms7792 KiB
66Wrong answer241ms7616 KiB