119632024-11-22 14:50:17tiktakbumbum12Számjegycserepython3Wrong answer 0/100556ms3560 KiB
N = int(input())
m = 0
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 '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
subtask20/21
2Wrong answer160ms3128 KiB
subtask30/23
3Wrong answer499ms3384 KiB
4Wrong answer504ms3384 KiB
5Wrong answer495ms3384 KiB
6Wrong answer497ms3384 KiB
7Wrong answer490ms3216 KiB
8Wrong answer501ms3156 KiB
9Wrong answer490ms3380 KiB
10Wrong answer485ms3388 KiB
11Wrong answer507ms3248 KiB
12Wrong answer500ms3408 KiB
13Wrong answer497ms3380 KiB
14Wrong answer492ms3208 KiB
15Wrong answer523ms3348 KiB
16Wrong answer497ms3164 KiB
17Wrong answer501ms3236 KiB
18Wrong answer481ms3228 KiB
19Wrong answer556ms3384 KiB
20Wrong answer481ms3404 KiB
21Wrong answer500ms3404 KiB
22Wrong answer507ms3384 KiB
23Wrong answer477ms3384 KiB
subtask40/41
24Accepted16ms3128 KiB
25Accepted16ms3120 KiB
26Accepted16ms3312 KiB
27Accepted16ms2972 KiB
28Accepted17ms3168 KiB
29Accepted16ms3120 KiB
30Accepted16ms3012 KiB
31Accepted16ms3152 KiB
32Accepted17ms3068 KiB
33Wrong answer17ms3012 KiB
34Accepted16ms3132 KiB
35Accepted16ms3128 KiB
36Accepted19ms3128 KiB
37Accepted52ms3112 KiB
38Accepted16ms3284 KiB
39Accepted17ms3152 KiB
40Accepted16ms2952 KiB
41Accepted17ms3160 KiB
42Accepted20ms3264 KiB
43Accepted19ms3084 KiB
44Accepted20ms3000 KiB
45Accepted20ms3144 KiB
46Wrong answer16ms3132 KiB
47Wrong answer19ms3156 KiB
subtask50/15
48Wrong answer21ms3320 KiB
49Wrong answer17ms3560 KiB
50Wrong answer497ms3368 KiB
51Wrong answer17ms3040 KiB
52Wrong answer108ms3228 KiB
53Accepted17ms3136 KiB
54Accepted23ms2948 KiB
55Accepted67ms3132 KiB
56Accepted508ms3384 KiB
57Accepted17ms3560 KiB
58Accepted17ms3560 KiB
59Accepted17ms3560 KiB
60Accepted23ms2964 KiB
61Accepted21ms3156 KiB
62Accepted23ms3128 KiB
63Accepted21ms3128 KiB
64Accepted500ms3416 KiB
65Accepted509ms3416 KiB
66Accepted490ms3384 KiB