119762024-11-22 15:16:47XetoxinoSzámjegycserepypy3Wrong answer 0/100583ms31884 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 K[-2] == '2' and '5' in K:
            m = 1
        elif K[-2] == '7' and '5' in K:
            m = 1
        elif K[-2] == '5' and '0' in K:
            m = 1
        elif K[-2] == '0' and '0' in K:
            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
1Accepted39ms19440 KiB
subtask20/21
2Wrong answer335ms28140 KiB
subtask30/23
3Wrong answer518ms29896 KiB
4Wrong answer523ms29652 KiB
5Wrong answer439ms27108 KiB
6Wrong answer528ms30068 KiB
7Wrong answer583ms29676 KiB
8Wrong answer465ms28648 KiB
9Wrong answer524ms29820 KiB
10Wrong answer479ms30524 KiB
11Wrong answer536ms29680 KiB
12Wrong answer522ms29676 KiB
13Accepted507ms30696 KiB
14Wrong answer439ms28452 KiB
15Wrong answer529ms30172 KiB
16Wrong answer504ms28572 KiB
17Wrong answer474ms29248 KiB
18Wrong answer483ms29164 KiB
19Accepted444ms27552 KiB
20Accepted432ms27628 KiB
21Wrong answer444ms28632 KiB
22Wrong answer521ms29932 KiB
23Wrong answer505ms29676 KiB
subtask40/41
24Accepted41ms19688 KiB
25Accepted46ms19624 KiB
26Accepted45ms19596 KiB
27Accepted41ms19532 KiB
28Accepted45ms19608 KiB
29Accepted45ms19736 KiB
30Accepted41ms19764 KiB
31Accepted41ms19616 KiB
32Accepted41ms19580 KiB
33Accepted45ms19688 KiB
34Accepted39ms19688 KiB
35Accepted52ms21232 KiB
36Accepted72ms21448 KiB
37Accepted101ms22980 KiB
38Accepted54ms21272 KiB
39Accepted56ms21360 KiB
40Accepted56ms21232 KiB
41Accepted52ms21260 KiB
42Accepted72ms21492 KiB
43Accepted72ms21648 KiB
44Accepted79ms21456 KiB
45Accepted79ms21600 KiB
46Accepted48ms21232 KiB
47Wrong answer70ms21464 KiB
subtask50/15
48Accepted90ms21656 KiB
49Accepted46ms21740 KiB
50Wrong answer550ms31884 KiB
51Accepted54ms21572 KiB
52Wrong answer197ms25072 KiB
53Accepted52ms21484 KiB
54Accepted97ms21480 KiB
55Accepted138ms23912 KiB
56Accepted337ms24044 KiB
57Accepted46ms21868 KiB
58Accepted54ms21708 KiB
59Accepted48ms21744 KiB
60Accepted83ms21480 KiB
61Accepted75ms21484 KiB
62Accepted86ms21496 KiB
63Accepted75ms21484 KiB
64Accepted324ms23532 KiB
65Accepted323ms23512 KiB
66Accepted321ms23584 KiB