121252024-12-03 12:08:40batmanSzámjegycserepython3Accepted 100/100568ms3752 KiB
T = int(input())
for i in range(T):
    N = input()

    v = -1
    nullas = N.count('0')
    if len(N) >= 2:
        if N[-2:] in ['00','25', '50', '75']:
            v = 0
        elif N[-2:] in ['52', '05', '57']:
            v = 1
        elif N[-1] == '5' and (('2' in N) or ('7' in N)):
            v = 1
        elif N[-1] == '0' and (('5' in N) or nullas >= 2):
            v = 1
        elif N[-2] in '72' and '5' in N:
            v = 1
        elif N[-2] == '5' and '0' in N:
            v = 1
        elif N[-2] == '0' and nullas >= 2:
            v = 1
        elif ('5' in N) and (('2' in N) or ('7' in N) or ('0' in N)):
            v = 2
        elif  nullas >= 2:
            v = 2
    print(v)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3128 KiB
subtask221/21
2Accepted179ms3080 KiB
subtask323/23
3Accepted518ms3396 KiB
4Accepted519ms3404 KiB
5Accepted561ms3388 KiB
6Accepted514ms3248 KiB
7Accepted526ms3384 KiB
8Accepted522ms3192 KiB
9Accepted518ms3384 KiB
10Accepted523ms3384 KiB
11Accepted507ms3440 KiB
12Accepted522ms3384 KiB
13Accepted517ms3384 KiB
14Accepted517ms3384 KiB
15Accepted513ms3384 KiB
16Accepted510ms3192 KiB
17Accepted510ms3448 KiB
18Accepted513ms3384 KiB
19Accepted568ms3264 KiB
20Accepted527ms3384 KiB
21Accepted507ms3240 KiB
22Accepted529ms3308 KiB
23Accepted488ms3384 KiB
subtask441/41
24Accepted16ms3052 KiB
25Accepted16ms3144 KiB
26Accepted16ms3316 KiB
27Accepted16ms3120 KiB
28Accepted16ms3212 KiB
29Accepted16ms3192 KiB
30Accepted16ms3152 KiB
31Accepted16ms3056 KiB
32Accepted16ms3320 KiB
33Accepted16ms3212 KiB
34Accepted16ms3320 KiB
35Accepted17ms3128 KiB
36Accepted21ms3004 KiB
37Accepted54ms3160 KiB
38Accepted16ms3128 KiB
39Accepted16ms3188 KiB
40Accepted17ms3128 KiB
41Accepted17ms3136 KiB
42Accepted20ms3128 KiB
43Accepted20ms3016 KiB
44Accepted19ms3128 KiB
45Accepted20ms3156 KiB
46Accepted16ms3128 KiB
47Accepted20ms3064 KiB
subtask515/15
48Accepted25ms3132 KiB
49Accepted19ms3752 KiB
50Accepted521ms3384 KiB
51Accepted20ms3128 KiB
52Accepted119ms3128 KiB
53Accepted17ms3128 KiB
54Accepted23ms3356 KiB
55Accepted68ms3100 KiB
56Accepted532ms3340 KiB
57Accepted18ms3560 KiB
58Accepted17ms3560 KiB
59Accepted17ms3668 KiB
60Accepted23ms3060 KiB
61Accepted21ms3152 KiB
62Accepted21ms3000 KiB
63Accepted21ms2996 KiB
64Accepted533ms3516 KiB
65Accepted526ms3440 KiB
66Accepted501ms3384 KiB