110902024-07-06 22:07:04probaSzámjegycserepython3Wrong answer 0/100398ms7836 KiB
# 50, 00, 25, 75
lista = [int(input()) for i in range(int(input()))]

for i in lista:
    tovabb = True
    
    # osztható 25-tel    
    if i % 25 == 0:
        print(0)
        tovabb = False
    
    # van benne 5-ös továbbá 2 vagy 7-es
    if tovabb and '5' in str(i) and ('2' in str(i) or '7' in str(i)):
        if str(i)[-1]=='5' or str(i)[-2]=='2' or str(i)[-2]=='7':
            print(1)
            tovabb = False
        else:
            if str(i)[-2]=='5' or str(i)[-1]=='2' or str(i)[-1]=='7':
                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] == '0' or str(i)[-2]=='5':
            print(1)
            tovabb = False
        else:
            if str(i)[-1] == '5' or str(i)[-2]=='0':
                print(1)
                tovabb = False
            else:
                print(2)
                tovabb = False
            

    # ha van benne 2 nulla
    if tovabb and str(i).count('0')>1:
        if str(i)[-1]=='0' or str(i)[-2]=='0':
            print(1)
            tovabb = False
        else:
            print(2)
            tovabb = False
            
    if tovabb:
        print(-1)
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3044 KiB
subtask20/21
2Wrong answer134ms4852 KiB
subtask30/23
3Wrong answer328ms7484 KiB
4Wrong answer326ms7812 KiB
5Wrong answer330ms7644 KiB
6Wrong answer337ms7644 KiB
7Wrong answer330ms7788 KiB
8Wrong answer384ms7648 KiB
9Wrong answer337ms7752 KiB
10Wrong answer326ms7812 KiB
11Wrong answer331ms7644 KiB
12Wrong answer342ms7772 KiB
13Wrong answer356ms7644 KiB
14Wrong answer326ms7640 KiB
15Wrong answer330ms7644 KiB
16Wrong answer398ms7644 KiB
17Wrong answer331ms7644 KiB
18Wrong answer337ms7644 KiB
19Wrong answer358ms7648 KiB
20Wrong answer358ms7684 KiB
21Wrong answer326ms7836 KiB
22Wrong answer335ms7784 KiB
23Wrong answer331ms7648 KiB
subtask40/41
24Accepted19ms3044 KiB
25Accepted19ms3188 KiB
26Accepted18ms3084 KiB
27Accepted18ms3088 KiB
28Accepted18ms3048 KiB
29Accepted18ms3172 KiB
30Accepted17ms3192 KiB
31Accepted18ms3172 KiB
32Accepted18ms3172 KiB
33Wrong answer19ms3300 KiB
34Accepted18ms2976 KiB
35Accepted18ms3044 KiB
36Accepted21ms3180 KiB
37Accepted45ms3356 KiB
38Accepted18ms3096 KiB
39Accepted17ms3044 KiB
40Accepted19ms3196 KiB
41Accepted18ms3172 KiB
42Accepted20ms3100 KiB
43Accepted20ms3172 KiB
44Accepted20ms3172 KiB
45Accepted23ms3248 KiB
46Wrong answer18ms3044 KiB
47Wrong answer20ms3300 KiB
subtask50/15
48Wrong answer171ms3684 KiB
49Runtime error17ms3304 KiB
50Wrong answer381ms7624 KiB
51Runtime error17ms3172 KiB
52Wrong answer120ms4480 KiB
53Runtime error17ms3064 KiB
54Accepted104ms3728 KiB
55Accepted65ms4196 KiB
56Accepted305ms7516 KiB
57Runtime error17ms3300 KiB
58Runtime error18ms3440 KiB
59Runtime error17ms3300 KiB
60Accepted98ms3728 KiB
61Accepted98ms3684 KiB
62Accepted143ms3568 KiB
63Accepted100ms3632 KiB
64Accepted301ms7652 KiB
65Accepted303ms7780 KiB
66Accepted303ms7704 KiB