110912024-07-06 22:11:44probaSzámjegycserepython3Wrong answer 0/100342ms7844 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':
            print(1)
            tovabb = False
        else:
            if str(i)[-2]=='5' and (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)[-2] == '5' or str(i)[-1]=='0':
            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 answer123ms4976 KiB
subtask30/23
3Wrong answer310ms7652 KiB
4Wrong answer321ms7644 KiB
5Wrong answer305ms7772 KiB
6Wrong answer319ms7708 KiB
7Wrong answer324ms7644 KiB
8Wrong answer337ms7644 KiB
9Wrong answer319ms7644 KiB
10Wrong answer310ms7688 KiB
11Wrong answer319ms7644 KiB
12Wrong answer319ms7824 KiB
13Wrong answer342ms7644 KiB
14Wrong answer303ms7780 KiB
15Wrong answer319ms7772 KiB
16Wrong answer337ms7680 KiB
17Wrong answer323ms7652 KiB
18Wrong answer312ms7828 KiB
19Wrong answer337ms7712 KiB
20Wrong answer328ms7648 KiB
21Wrong answer310ms7844 KiB
22Wrong answer324ms7696 KiB
23Wrong answer324ms7648 KiB
subtask40/41
24Accepted19ms3044 KiB
25Accepted18ms3064 KiB
26Accepted18ms3084 KiB
27Accepted18ms3320 KiB
28Accepted19ms3044 KiB
29Accepted18ms3196 KiB
30Accepted18ms3196 KiB
31Accepted19ms3044 KiB
32Accepted19ms3044 KiB
33Wrong answer19ms3088 KiB
34Accepted19ms3192 KiB
35Accepted18ms3044 KiB
36Accepted21ms3216 KiB
37Accepted45ms3432 KiB
38Accepted18ms3084 KiB
39Accepted18ms3064 KiB
40Accepted17ms3064 KiB
41Accepted18ms3044 KiB
42Accepted21ms3460 KiB
43Accepted21ms3044 KiB
44Accepted20ms3192 KiB
45Accepted20ms3236 KiB
46Wrong answer18ms3044 KiB
47Wrong answer20ms3216 KiB
subtask50/15
48Wrong answer119ms3756 KiB
49Runtime error18ms3364 KiB
50Wrong answer342ms7652 KiB
51Runtime error17ms3196 KiB
52Wrong answer103ms4580 KiB
53Runtime error18ms3320 KiB
54Accepted104ms3684 KiB
55Accepted65ms4196 KiB
56Accepted317ms7696 KiB
57Runtime error17ms3300 KiB
58Runtime error17ms3344 KiB
59Runtime error18ms3452 KiB
60Accepted100ms3684 KiB
61Accepted100ms3684 KiB
62Accepted143ms3680 KiB
63Accepted100ms3684 KiB
64Accepted310ms7676 KiB
65Accepted307ms7612 KiB
66Accepted307ms7664 KiB