110932024-07-06 22:28:28probaSzámjegycserepython3Wrong answer 0/100321ms7876 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 str(i) and '5' in str(i):
            if str(i)[-1] == '5' and str(i)[-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 answer17ms3044 KiB
subtask20/21
2Wrong answer118ms4928 KiB
subtask30/23
3Wrong answer280ms7452 KiB
4Wrong answer282ms7540 KiB
5Wrong answer284ms7664 KiB
6Wrong answer282ms7664 KiB
7Wrong answer282ms7796 KiB
8Wrong answer312ms7876 KiB
9Wrong answer282ms7664 KiB
10Wrong answer287ms7664 KiB
11Wrong answer287ms7652 KiB
12Wrong answer282ms7620 KiB
13Wrong answer300ms7688 KiB
14Wrong answer287ms7592 KiB
15Wrong answer282ms7740 KiB
16Wrong answer321ms7860 KiB
17Wrong answer287ms7624 KiB
18Wrong answer291ms7704 KiB
19Wrong answer300ms7624 KiB
20Wrong answer296ms7624 KiB
21Wrong answer289ms7624 KiB
22Wrong answer293ms7624 KiB
23Wrong answer282ms7624 KiB
subtask40/41
24Wrong answer18ms2916 KiB
25Wrong answer18ms3044 KiB
26Wrong answer17ms3168 KiB
27Wrong answer18ms2952 KiB
28Wrong answer18ms2916 KiB
29Wrong answer19ms3216 KiB
30Wrong answer17ms3192 KiB
31Wrong answer18ms3304 KiB
32Wrong answer17ms2916 KiB
33Wrong answer17ms3088 KiB
34Wrong answer18ms3108 KiB
35Wrong answer17ms3192 KiB
36Wrong answer19ms3176 KiB
37Wrong answer41ms3556 KiB
38Wrong answer18ms3080 KiB
39Wrong answer17ms3192 KiB
40Wrong answer17ms2972 KiB
41Wrong answer17ms3064 KiB
42Wrong answer20ms3320 KiB
43Wrong answer19ms3100 KiB
44Wrong answer19ms3172 KiB
45Wrong answer20ms3172 KiB
46Wrong answer19ms3024 KiB
47Wrong answer20ms3100 KiB
subtask50/15
48Wrong answer57ms3728 KiB
49Runtime error18ms3300 KiB
50Wrong answer316ms7752 KiB
51Runtime error18ms3076 KiB
52Wrong answer90ms4764 KiB
53Runtime error17ms3064 KiB
54Wrong answer76ms3556 KiB
55Wrong answer57ms4324 KiB
56Wrong answer264ms7572 KiB
57Runtime error17ms3172 KiB
58Runtime error18ms3172 KiB
59Runtime error18ms3172 KiB
60Wrong answer76ms3704 KiB
61Wrong answer76ms3556 KiB
62Wrong answer76ms3684 KiB
63Wrong answer76ms3484 KiB
64Wrong answer263ms7568 KiB
65Wrong answer266ms7540 KiB
66Wrong answer266ms7496 KiB