115992024-10-29 22:44:09KezdőSzámjegycserepython3Runtime error 0/10017ms3380 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 ('5' in N or nul >= ):
            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
1Runtime error16ms3144 KiB
subtask20/21
2Runtime error14ms3128 KiB
subtask30/23
3Runtime error16ms3140 KiB
4Runtime error16ms3116 KiB
5Runtime error16ms3104 KiB
6Runtime error16ms3128 KiB
7Runtime error16ms3104 KiB
8Runtime error16ms3128 KiB
9Runtime error14ms3144 KiB
10Runtime error16ms3128 KiB
11Runtime error16ms3128 KiB
12Runtime error14ms3124 KiB
13Runtime error16ms3340 KiB
14Runtime error17ms3128 KiB
15Runtime error16ms3128 KiB
16Runtime error16ms3380 KiB
17Runtime error14ms3132 KiB
18Runtime error16ms3128 KiB
19Runtime error17ms3056 KiB
20Runtime error16ms3320 KiB
21Runtime error16ms3312 KiB
22Runtime error16ms3120 KiB
23Runtime error16ms3128 KiB
subtask40/41
24Runtime error16ms3128 KiB
25Runtime error14ms3128 KiB
26Runtime error16ms2956 KiB
27Runtime error16ms3012 KiB
28Runtime error16ms3104 KiB
29Runtime error16ms2984 KiB
30Runtime error14ms3084 KiB
31Runtime error14ms3024 KiB
32Runtime error16ms3144 KiB
33Runtime error16ms3132 KiB
34Runtime error16ms3128 KiB
35Runtime error16ms3120 KiB
36Runtime error17ms3000 KiB
37Runtime error16ms3152 KiB
38Runtime error16ms3128 KiB
39Runtime error16ms2976 KiB
40Runtime error16ms3132 KiB
41Runtime error16ms3064 KiB
42Runtime error16ms3144 KiB
43Runtime error14ms3332 KiB
44Runtime error16ms3064 KiB
45Runtime error16ms2996 KiB
46Runtime error16ms3120 KiB
47Runtime error16ms3072 KiB
subtask50/15
48Runtime error16ms3140 KiB
49Runtime error14ms3040 KiB
50Runtime error16ms3088 KiB
51Runtime error16ms3000 KiB
52Runtime error17ms3072 KiB
53Runtime error16ms3100 KiB
54Runtime error16ms3156 KiB
55Runtime error16ms3076 KiB
56Runtime error17ms3128 KiB
57Runtime error16ms2952 KiB
58Runtime error16ms3116 KiB
59Runtime error14ms3128 KiB
60Runtime error17ms3128 KiB
61Runtime error17ms3112 KiB
62Runtime error16ms3128 KiB
63Runtime error16ms3176 KiB
64Runtime error16ms3128 KiB
65Runtime error16ms3120 KiB
66Runtime error16ms3144 KiB