120372024-11-26 12:10:03LumiNoxSzámjegycserepython3Accepted 100/100550ms3580 KiB
N = int(input())
m = -1
for i in range(N):
    K = input()
    if len(K) >= 2:
        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 K[-2] == '2' and  ('5' in K ):
            m = 1
        elif K[-2] == '5' and ('0' in K ):
            m = 1
        elif K[-2] == '7' and ('5' in K):
            m = 1
        elif K[-2] == '0' and K.count('0')>= 2:
            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
    else:
        m = -1

    print(m)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3128 KiB
subtask221/21
2Accepted171ms3128 KiB
subtask323/23
3Accepted531ms3388 KiB
4Accepted518ms3384 KiB
5Accepted523ms3388 KiB
6Accepted523ms3384 KiB
7Accepted529ms3468 KiB
8Accepted519ms3204 KiB
9Accepted550ms3492 KiB
10Accepted523ms3216 KiB
11Accepted517ms3384 KiB
12Accepted538ms3308 KiB
13Accepted524ms3384 KiB
14Accepted515ms3264 KiB
15Accepted527ms3384 KiB
16Accepted526ms3336 KiB
17Accepted509ms3456 KiB
18Accepted515ms3456 KiB
19Accepted545ms3220 KiB
20Accepted512ms3456 KiB
21Accepted523ms3420 KiB
22Accepted533ms3420 KiB
23Accepted505ms3384 KiB
subtask441/41
24Accepted16ms3116 KiB
25Accepted16ms3132 KiB
26Accepted16ms3320 KiB
27Accepted16ms3128 KiB
28Accepted16ms3204 KiB
29Accepted16ms3204 KiB
30Accepted16ms3004 KiB
31Accepted14ms3128 KiB
32Accepted17ms3084 KiB
33Accepted16ms3032 KiB
34Accepted16ms3032 KiB
35Accepted17ms3196 KiB
36Accepted21ms3192 KiB
37Accepted54ms3128 KiB
38Accepted17ms3128 KiB
39Accepted17ms3156 KiB
40Accepted16ms3188 KiB
41Accepted16ms3108 KiB
42Accepted20ms3200 KiB
43Accepted20ms3036 KiB
44Accepted20ms3084 KiB
45Accepted19ms2984 KiB
46Accepted17ms3132 KiB
47Accepted20ms3184 KiB
subtask515/15
48Accepted21ms3128 KiB
49Accepted17ms3556 KiB
50Accepted510ms3380 KiB
51Accepted17ms3040 KiB
52Accepted111ms3128 KiB
53Accepted17ms3128 KiB
54Accepted23ms3120 KiB
55Accepted70ms3128 KiB
56Accepted547ms3384 KiB
57Accepted17ms3580 KiB
58Accepted17ms3560 KiB
59Accepted17ms3560 KiB
60Accepted23ms3064 KiB
61Accepted23ms3128 KiB
62Accepted23ms3128 KiB
63Accepted23ms3200 KiB
64Accepted541ms3384 KiB
65Accepted527ms3408 KiB
66Accepted518ms3384 KiB