118942024-11-15 19:22:47LenglZalanMorSzámjegycserepython3Wrong answer 0/100564ms3564 KiB
N = int(input())
m = -1
M = 9
for i in range(N):
    K = input()
    if K == ['0','1','2','3','4','5','6','7','8','9']:
        m = -1
    else:
        if K[-2:] in ['00','25','50','75']:
            m = 0
        elif K[-2:] in ['52','05','57']:
            m = 1
        elif K[-1] == '5' and ('2' in K or '7' in K[:-1]):
            m = 1
        elif K[-1] == '0' and ('5' in K or '0' in K[:-1]):
            m = 1
        elif '2' in K and '5' in K:
            m = 2
        elif '5' in K and '7' in K:
            m = 2
        elif K.count('0') > 1:
            m = 2
        elif '5' in K and '0' in K:
            m = 2
        else:
             m = -1

        print(m)
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted14ms3128 KiB
subtask20/21
2Wrong answer168ms3132 KiB
subtask30/23
3Wrong answer510ms3380 KiB
4Wrong answer545ms3384 KiB
5Wrong answer501ms3332 KiB
6Wrong answer508ms3380 KiB
7Wrong answer499ms3384 KiB
8Wrong answer495ms3180 KiB
9Wrong answer500ms3384 KiB
10Wrong answer524ms3332 KiB
11Wrong answer509ms3384 KiB
12Wrong answer518ms3388 KiB
13Wrong answer513ms3384 KiB
14Wrong answer564ms3444 KiB
15Wrong answer510ms3388 KiB
16Wrong answer493ms3384 KiB
17Wrong answer513ms3236 KiB
18Wrong answer495ms3384 KiB
19Wrong answer504ms3188 KiB
20Wrong answer500ms3428 KiB
21Wrong answer501ms3440 KiB
22Wrong answer542ms3384 KiB
23Wrong answer477ms3440 KiB
subtask40/41
24Accepted16ms3124 KiB
25Accepted17ms3128 KiB
26Accepted16ms3196 KiB
27Accepted16ms3120 KiB
28Accepted14ms3000 KiB
29Accepted16ms3032 KiB
30Accepted16ms3200 KiB
31Accepted16ms3152 KiB
32Accepted16ms3132 KiB
33Wrong answer16ms3128 KiB
34Accepted16ms3136 KiB
35Accepted16ms3128 KiB
36Accepted20ms3124 KiB
37Accepted61ms3188 KiB
38Accepted16ms3128 KiB
39Accepted16ms3092 KiB
40Accepted17ms2972 KiB
41Accepted16ms3020 KiB
42Accepted19ms3000 KiB
43Accepted20ms3128 KiB
44Accepted20ms3116 KiB
45Accepted20ms3128 KiB
46Wrong answer16ms3168 KiB
47Wrong answer19ms3360 KiB
subtask50/15
48Wrong answer21ms3196 KiB
49Wrong answer17ms3448 KiB
50Wrong answer492ms3384 KiB
51Wrong answer17ms3128 KiB
52Wrong answer112ms3192 KiB
53Accepted17ms3128 KiB
54Accepted21ms3180 KiB
55Accepted68ms3208 KiB
56Accepted523ms3448 KiB
57Accepted17ms3564 KiB
58Accepted17ms3560 KiB
59Accepted17ms3560 KiB
60Accepted23ms3104 KiB
61Accepted21ms3172 KiB
62Accepted23ms2992 KiB
63Accepted21ms3096 KiB
64Accepted508ms3448 KiB
65Accepted533ms3308 KiB
66Accepted500ms3388 KiB