110892024-07-06 21:59:14probaSzámjegycserepython3Wrong answer 0/100354ms7764 KiB
# 50, 00, 25, 75
lista = [int(input()) for i in range(int(input()))]

for i in lista:
    ok = False
    if i % 25 == 0:
        print(0)
        ok = True
    
    if not ok 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)
            ok = True
        else:
            print(2)
            ok = True
    
    if not ok and '0' in str(i) and '5' in str(i):
        if str(i)[-1] == '0' or str(i)[-2]=='5':
            print(1)
            ok = True
        else:
            print(2)
            ok = True
    
    if not ok and str(i).count('0')>1:
        if str(i)[-1]=='0' or str(i)[-2]=='0':
            print(1)
            ok = True
        else:
            print(2)
            ok = True
            
    if not ok:
        print(-1)
        
        
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3044 KiB
subtask20/21
2Wrong answer123ms4940 KiB
subtask30/23
3Wrong answer312ms7636 KiB
4Wrong answer319ms7636 KiB
5Wrong answer308ms7680 KiB
6Wrong answer326ms7636 KiB
7Wrong answer319ms7764 KiB
8Wrong answer342ms7700 KiB
9Wrong answer317ms7636 KiB
10Wrong answer314ms7656 KiB
11Wrong answer317ms7636 KiB
12Wrong answer319ms7700 KiB
13Wrong answer354ms7640 KiB
14Wrong answer312ms7640 KiB
15Wrong answer323ms7640 KiB
16Wrong answer342ms7500 KiB
17Wrong answer321ms7696 KiB
18Wrong answer324ms7716 KiB
19Wrong answer337ms7632 KiB
20Wrong answer335ms7740 KiB
21Wrong answer312ms7760 KiB
22Wrong answer323ms7696 KiB
23Wrong answer317ms7632 KiB
subtask40/41
24Accepted18ms3044 KiB
25Accepted18ms3044 KiB
26Accepted18ms3124 KiB
27Accepted18ms3180 KiB
28Accepted19ms3116 KiB
29Accepted19ms3104 KiB
30Accepted18ms3172 KiB
31Accepted19ms3216 KiB
32Accepted18ms2992 KiB
33Wrong answer18ms3108 KiB
34Accepted19ms3044 KiB
35Accepted18ms3172 KiB
36Accepted21ms3120 KiB
37Accepted46ms3428 KiB
38Accepted18ms3180 KiB
39Accepted17ms3044 KiB
40Accepted18ms3092 KiB
41Accepted18ms3044 KiB
42Accepted20ms3216 KiB
43Accepted21ms3176 KiB
44Accepted20ms3356 KiB
45Accepted21ms3340 KiB
46Wrong answer18ms3088 KiB
47Wrong answer20ms3172 KiB
subtask50/15
48Wrong answer133ms3660 KiB
49Runtime error19ms3300 KiB
50Wrong answer351ms7500 KiB
51Runtime error17ms3044 KiB
52Wrong answer107ms4688 KiB
53Runtime error17ms3044 KiB
54Accepted105ms3728 KiB
55Accepted67ms4196 KiB
56Accepted307ms7592 KiB
57Runtime error17ms3344 KiB
58Runtime error17ms3300 KiB
59Runtime error18ms3300 KiB
60Accepted101ms3684 KiB
61Accepted101ms3668 KiB
62Accepted144ms3728 KiB
63Accepted101ms3728 KiB
64Accepted305ms7676 KiB
65Accepted303ms7612 KiB
66Accepted305ms7656 KiB