110952024-07-06 22:39:45probaSzámjegycserepython3Wrong answer 0/100280ms7888 KiB
# 50, 00, 25, 75
lista = [int(input()) for i in range(int(input()))]
#lista = [157, 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
1Accepted17ms3044 KiB
subtask20/21
2Wrong answer101ms4716 KiB
subtask30/23
3Wrong answer256ms7620 KiB
4Wrong answer259ms7620 KiB
5Wrong answer266ms7620 KiB
6Wrong answer261ms7548 KiB
7Wrong answer263ms7620 KiB
8Wrong answer266ms7772 KiB
9Wrong answer257ms7684 KiB
10Wrong answer256ms7656 KiB
11Wrong answer259ms7684 KiB
12Wrong answer259ms7656 KiB
13Wrong answer264ms7684 KiB
14Wrong answer263ms7608 KiB
15Wrong answer261ms7536 KiB
16Wrong answer268ms7800 KiB
17Wrong answer263ms7888 KiB
18Wrong answer263ms7624 KiB
19Wrong answer273ms7624 KiB
20Wrong answer266ms7624 KiB
21Wrong answer259ms7600 KiB
22Wrong answer264ms7692 KiB
23Wrong answer261ms7620 KiB
subtask40/41
24Accepted18ms3244 KiB
25Accepted18ms3080 KiB
26Accepted18ms3044 KiB
27Accepted18ms3180 KiB
28Accepted18ms3044 KiB
29Accepted18ms3044 KiB
30Accepted18ms3088 KiB
31Accepted17ms3172 KiB
32Accepted18ms3044 KiB
33Wrong answer18ms3060 KiB
34Accepted17ms2920 KiB
35Accepted17ms3044 KiB
36Accepted19ms3100 KiB
37Accepted43ms3416 KiB
38Accepted18ms3324 KiB
39Accepted17ms3032 KiB
40Accepted17ms2916 KiB
41Accepted17ms3088 KiB
42Accepted19ms3228 KiB
43Accepted19ms3172 KiB
44Accepted21ms3056 KiB
45Accepted20ms3228 KiB
46Wrong answer17ms3064 KiB
47Wrong answer20ms3044 KiB
subtask50/15
48Wrong answer57ms3460 KiB
49Runtime error18ms3256 KiB
50Wrong answer280ms7616 KiB
51Runtime error17ms2988 KiB
52Wrong answer82ms4828 KiB
53Runtime error18ms3044 KiB
54Accepted57ms3684 KiB
55Accepted54ms4088 KiB
56Accepted261ms7444 KiB
57Runtime error18ms3428 KiB
58Runtime error18ms3300 KiB
59Runtime error17ms3320 KiB
60Accepted56ms3684 KiB
61Accepted57ms3684 KiB
62Accepted57ms3700 KiB
63Accepted57ms3596 KiB
64Accepted263ms7624 KiB
65Accepted264ms7624 KiB
66Accepted259ms7624 KiB