116012024-10-29 23:36:18KezdőSzámjegycserepython3Runtime error 0/10017ms3512 KiB
T = int(input())
for i in range(T):
    N = input()
##s = [300,325,50,75,215,6715,540,20040,520,5073,205,2003,157,1001,152,7500,7005,200253,52,22,10011,55,505]
##for x in s:
##    N = str(x)
##    v = -1
##    nul = N.count('0')
    if len(N) >= 2:
        if N[-2:] in ['00','25', '50', '75']:
            v = 0
        elif N[-2:] in ['52', '05', '57']:
            v = 1
        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
1Runtime error14ms3128 KiB
subtask20/21
2Runtime error14ms3132 KiB
subtask30/23
3Runtime error16ms3128 KiB
4Runtime error17ms3164 KiB
5Runtime error16ms3080 KiB
6Runtime error16ms3080 KiB
7Runtime error16ms3128 KiB
8Runtime error16ms3180 KiB
9Runtime error17ms3224 KiB
10Runtime error16ms3128 KiB
11Runtime error16ms3128 KiB
12Runtime error14ms3132 KiB
13Runtime error16ms3164 KiB
14Runtime error16ms3160 KiB
15Runtime error16ms3128 KiB
16Runtime error16ms3128 KiB
17Runtime error16ms3132 KiB
18Runtime error17ms3320 KiB
19Runtime error17ms3324 KiB
20Runtime error17ms3196 KiB
21Runtime error17ms3136 KiB
22Runtime error16ms3128 KiB
23Runtime error17ms3104 KiB
subtask40/41
24Runtime error16ms3164 KiB
25Runtime error14ms2992 KiB
26Runtime error16ms3140 KiB
27Runtime error16ms3128 KiB
28Runtime error16ms3160 KiB
29Runtime error17ms3152 KiB
30Runtime error16ms2964 KiB
31Runtime error16ms2988 KiB
32Runtime error16ms3128 KiB
33Runtime error17ms3128 KiB
34Runtime error16ms3128 KiB
35Runtime error16ms3144 KiB
36Runtime error16ms2956 KiB
37Runtime error16ms3068 KiB
38Runtime error16ms2980 KiB
39Runtime error14ms2984 KiB
40Runtime error16ms3128 KiB
41Runtime error17ms3152 KiB
42Runtime error17ms3124 KiB
43Runtime error16ms3320 KiB
44Runtime error16ms3128 KiB
45Runtime error16ms3316 KiB
46Runtime error16ms2944 KiB
47Runtime error16ms3296 KiB
subtask50/15
48Runtime error16ms3128 KiB
49Runtime error17ms3356 KiB
50Runtime error14ms3016 KiB
51Runtime error16ms3160 KiB
52Runtime error16ms2980 KiB
53Runtime error16ms3192 KiB
54Runtime error14ms2992 KiB
55Runtime error16ms3160 KiB
56Runtime error17ms3132 KiB
57Accepted17ms3512 KiB
58Runtime error16ms3276 KiB
59Runtime error16ms3276 KiB
60Runtime error17ms3160 KiB
61Runtime error16ms3128 KiB
62Runtime error16ms3036 KiB
63Runtime error16ms3108 KiB
64Runtime error16ms3016 KiB
65Runtime error16ms2972 KiB
66Runtime error14ms3128 KiB