122092024-12-09 12:53:20CsongiSzámjegycserepython3Wrong answer 21/100527ms3560 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] == '0' and (('5' in n) or bnull):
            print("1")
        elif n[-1] == '5' and (('2' in n) or ('7' in n)):
            print("1")
        elif n[-2] in "27" 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
1Accepted16ms3128 KiB
subtask221/21
2Accepted172ms3128 KiB
subtask30/23
3Wrong answer507ms3396 KiB
4Accepted505ms3388 KiB
5Accepted527ms3384 KiB
6Accepted504ms3364 KiB
7Accepted493ms3380 KiB
8Accepted497ms3312 KiB
9Accepted504ms3432 KiB
10Accepted500ms3392 KiB
11Accepted504ms3384 KiB
12Accepted504ms3452 KiB
13Accepted495ms3384 KiB
14Accepted503ms3444 KiB
15Accepted514ms3384 KiB
16Accepted527ms3384 KiB
17Accepted512ms3384 KiB
18Accepted507ms3388 KiB
19Accepted501ms3384 KiB
20Accepted517ms3440 KiB
21Accepted517ms3252 KiB
22Accepted500ms3336 KiB
23Accepted493ms3384 KiB
subtask40/41
24Accepted16ms3128 KiB
25Accepted17ms3124 KiB
26Accepted17ms3120 KiB
27Accepted16ms3304 KiB
28Accepted16ms3324 KiB
29Accepted16ms3136 KiB
30Accepted16ms3120 KiB
31Accepted16ms3132 KiB
32Accepted17ms3164 KiB
33Accepted16ms3136 KiB
34Accepted16ms3044 KiB
35Accepted16ms3128 KiB
36Accepted20ms3128 KiB
37Wrong answer28ms3188 KiB
38Accepted17ms3128 KiB
39Accepted16ms3432 KiB
40Accepted16ms3204 KiB
41Accepted16ms3140 KiB
42Accepted21ms3172 KiB
43Accepted19ms3176 KiB
44Accepted20ms3040 KiB
45Accepted20ms2988 KiB
46Accepted17ms2992 KiB
47Accepted19ms3184 KiB
subtask50/15
48Accepted25ms3324 KiB
49Accepted20ms3560 KiB
50Accepted517ms3384 KiB
51Accepted20ms3048 KiB
52Wrong answer118ms3192 KiB
53Accepted17ms3128 KiB
54Accepted21ms3184 KiB
55Accepted72ms3188 KiB
56Accepted513ms3460 KiB
57Accepted19ms3508 KiB
58Accepted17ms3560 KiB
59Accepted17ms3528 KiB
60Accepted23ms3128 KiB
61Accepted23ms3016 KiB
62Accepted23ms3132 KiB
63Accepted23ms3128 KiB
64Accepted521ms3384 KiB
65Accepted513ms3444 KiB
66Accepted495ms3384 KiB