116002024-10-29 22:48:25KezdőSzámjegycserepython3Wrong answer 0/100555ms3568 KiB
T = int(input())
for i in range(T):
    N = input()
    v = -1
    nul = N.count('0')
    if len(N) >= 2:
        if N[-2:] in ['00','25', '50', '75']:
            v = 0
        elif N[-1] == '5' and (('2' in N) or ('7' in N)):
            v = 1
        elif N[-1] == '0' and (('5' in N) or nul >= 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 nul >= 2:
            v = 1
        elif ('5' in N) and (('2' in N) or ('7' in N) or ('0' in N)):
            v = 2
        elif  nul >= 2:
            v = 2
    print(v)
    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3128 KiB
subtask20/21
2Wrong answer173ms3128 KiB
subtask30/23
3Wrong answer509ms3408 KiB
4Wrong answer500ms3384 KiB
5Wrong answer488ms3384 KiB
6Wrong answer510ms3380 KiB
7Wrong answer508ms3244 KiB
8Wrong answer515ms3164 KiB
9Wrong answer508ms3408 KiB
10Wrong answer522ms3404 KiB
11Wrong answer499ms3384 KiB
12Wrong answer497ms3416 KiB
13Accepted492ms3420 KiB
14Wrong answer497ms3220 KiB
15Wrong answer500ms3384 KiB
16Wrong answer488ms3384 KiB
17Wrong answer493ms3388 KiB
18Wrong answer497ms3396 KiB
19Accepted483ms3416 KiB
20Accepted504ms3412 KiB
21Wrong answer549ms3320 KiB
22Wrong answer510ms3384 KiB
23Wrong answer479ms3384 KiB
subtask40/41
24Accepted17ms3072 KiB
25Accepted16ms3380 KiB
26Accepted17ms3024 KiB
27Accepted16ms3132 KiB
28Accepted16ms2988 KiB
29Accepted17ms3096 KiB
30Accepted16ms2948 KiB
31Accepted16ms3128 KiB
32Accepted16ms3076 KiB
33Accepted16ms3128 KiB
34Accepted17ms3128 KiB
35Accepted17ms3124 KiB
36Accepted21ms3060 KiB
37Accepted57ms3048 KiB
38Accepted16ms3132 KiB
39Accepted16ms3044 KiB
40Accepted16ms3068 KiB
41Accepted16ms3008 KiB
42Accepted20ms3080 KiB
43Accepted19ms3076 KiB
44Accepted19ms3120 KiB
45Accepted20ms3140 KiB
46Accepted16ms3132 KiB
47Wrong answer19ms3128 KiB
subtask50/15
48Accepted24ms3128 KiB
49Accepted18ms3560 KiB
50Wrong answer490ms3320 KiB
51Accepted20ms3124 KiB
52Wrong answer114ms3128 KiB
53Accepted17ms3072 KiB
54Accepted24ms3172 KiB
55Accepted65ms3216 KiB
56Accepted555ms3372 KiB
57Accepted18ms3568 KiB
58Accepted17ms3472 KiB
59Accepted17ms3460 KiB
60Accepted21ms3156 KiB
61Accepted21ms3168 KiB
62Accepted21ms3180 KiB
63Accepted21ms3128 KiB
64Accepted495ms3420 KiB
65Accepted497ms3340 KiB
66Accepted485ms3384 KiB