122102024-12-09 12:55:42CsongiSzámjegycserepython3Wrong answer 21/100569ms3700 KiB
t = int(input())

for x in range(t):
    n = input()
    bnull = n.count('0') >= 2

    if len(n) >= 2:
        if n[-2:] in ['00', '75', '50', '25']:
            print("0")
        elif n[-2:] in ['05', '52', '57']:
            print("1")
        elif n[-1] == '5' and (('2' in n) or ('7' in n)):
            print("1")
        elif n[-1] == '0' and (('5' in n) or bnull):
            print("1")
        elif n[-2] in '72' and '5' in n:
            print("1")
        elif n[-2] == '5' and '0' in n:
            print("1")
        elif n[-2] == '0' and bnull:
            print("1")
        elif ('5' in n) and (('2' in n) or ('7' in n) or ('0' in n)):
            print("2")
        elif bnull:
            print("2")
        else:
            print("-1")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted14ms3104 KiB
subtask221/21
2Accepted177ms3208 KiB
subtask30/23
3Wrong answer509ms3384 KiB
4Accepted500ms3240 KiB
5Accepted508ms3228 KiB
6Accepted510ms3384 KiB
7Accepted510ms3364 KiB
8Accepted514ms3336 KiB
9Accepted503ms3324 KiB
10Accepted509ms3252 KiB
11Accepted560ms3384 KiB
12Accepted515ms3460 KiB
13Accepted503ms3188 KiB
14Accepted509ms3384 KiB
15Accepted517ms3384 KiB
16Accepted510ms3384 KiB
17Accepted512ms3384 KiB
18Accepted569ms3384 KiB
19Accepted505ms3384 KiB
20Accepted500ms3384 KiB
21Accepted503ms3448 KiB
22Accepted495ms3384 KiB
23Accepted490ms3396 KiB
subtask40/41
24Accepted16ms3124 KiB
25Accepted17ms3128 KiB
26Accepted16ms3140 KiB
27Accepted17ms3128 KiB
28Accepted16ms3200 KiB
29Accepted14ms3128 KiB
30Accepted16ms3128 KiB
31Accepted14ms3128 KiB
32Accepted16ms3072 KiB
33Accepted16ms2984 KiB
34Accepted16ms3188 KiB
35Accepted16ms3040 KiB
36Accepted20ms3116 KiB
37Wrong answer29ms3136 KiB
38Accepted16ms3124 KiB
39Accepted16ms3396 KiB
40Accepted17ms2964 KiB
41Accepted16ms2964 KiB
42Accepted20ms2956 KiB
43Accepted20ms3128 KiB
44Accepted20ms3148 KiB
45Accepted20ms3124 KiB
46Accepted16ms3020 KiB
47Accepted20ms3128 KiB
subtask50/15
48Accepted24ms3136 KiB
49Accepted19ms3576 KiB
50Accepted513ms3384 KiB
51Accepted20ms3144 KiB
52Wrong answer115ms3196 KiB
53Accepted17ms3128 KiB
54Accepted21ms3196 KiB
55Accepted68ms3048 KiB
56Accepted532ms3700 KiB
57Accepted18ms3560 KiB
58Accepted17ms3448 KiB
59Accepted17ms3564 KiB
60Accepted23ms2964 KiB
61Accepted21ms3188 KiB
62Accepted23ms3128 KiB
63Accepted21ms3084 KiB
64Accepted528ms3452 KiB
65Accepted513ms3448 KiB
66Accepted504ms3432 KiB