11601 | 2024-10-29 23:36:18 | Kezdő | Számjegycsere | python3 | Runtime error 0/100 | 17ms | 3512 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)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 14ms | 3128 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Runtime error | 14ms | 3132 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Runtime error | 16ms | 3128 KiB | ||||
4 | Runtime error | 17ms | 3164 KiB | ||||
5 | Runtime error | 16ms | 3080 KiB | ||||
6 | Runtime error | 16ms | 3080 KiB | ||||
7 | Runtime error | 16ms | 3128 KiB | ||||
8 | Runtime error | 16ms | 3180 KiB | ||||
9 | Runtime error | 17ms | 3224 KiB | ||||
10 | Runtime error | 16ms | 3128 KiB | ||||
11 | Runtime error | 16ms | 3128 KiB | ||||
12 | Runtime error | 14ms | 3132 KiB | ||||
13 | Runtime error | 16ms | 3164 KiB | ||||
14 | Runtime error | 16ms | 3160 KiB | ||||
15 | Runtime error | 16ms | 3128 KiB | ||||
16 | Runtime error | 16ms | 3128 KiB | ||||
17 | Runtime error | 16ms | 3132 KiB | ||||
18 | Runtime error | 17ms | 3320 KiB | ||||
19 | Runtime error | 17ms | 3324 KiB | ||||
20 | Runtime error | 17ms | 3196 KiB | ||||
21 | Runtime error | 17ms | 3136 KiB | ||||
22 | Runtime error | 16ms | 3128 KiB | ||||
23 | Runtime error | 17ms | 3104 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Runtime error | 16ms | 3164 KiB | ||||
25 | Runtime error | 14ms | 2992 KiB | ||||
26 | Runtime error | 16ms | 3140 KiB | ||||
27 | Runtime error | 16ms | 3128 KiB | ||||
28 | Runtime error | 16ms | 3160 KiB | ||||
29 | Runtime error | 17ms | 3152 KiB | ||||
30 | Runtime error | 16ms | 2964 KiB | ||||
31 | Runtime error | 16ms | 2988 KiB | ||||
32 | Runtime error | 16ms | 3128 KiB | ||||
33 | Runtime error | 17ms | 3128 KiB | ||||
34 | Runtime error | 16ms | 3128 KiB | ||||
35 | Runtime error | 16ms | 3144 KiB | ||||
36 | Runtime error | 16ms | 2956 KiB | ||||
37 | Runtime error | 16ms | 3068 KiB | ||||
38 | Runtime error | 16ms | 2980 KiB | ||||
39 | Runtime error | 14ms | 2984 KiB | ||||
40 | Runtime error | 16ms | 3128 KiB | ||||
41 | Runtime error | 17ms | 3152 KiB | ||||
42 | Runtime error | 17ms | 3124 KiB | ||||
43 | Runtime error | 16ms | 3320 KiB | ||||
44 | Runtime error | 16ms | 3128 KiB | ||||
45 | Runtime error | 16ms | 3316 KiB | ||||
46 | Runtime error | 16ms | 2944 KiB | ||||
47 | Runtime error | 16ms | 3296 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Runtime error | 16ms | 3128 KiB | ||||
49 | Runtime error | 17ms | 3356 KiB | ||||
50 | Runtime error | 14ms | 3016 KiB | ||||
51 | Runtime error | 16ms | 3160 KiB | ||||
52 | Runtime error | 16ms | 2980 KiB | ||||
53 | Runtime error | 16ms | 3192 KiB | ||||
54 | Runtime error | 14ms | 2992 KiB | ||||
55 | Runtime error | 16ms | 3160 KiB | ||||
56 | Runtime error | 17ms | 3132 KiB | ||||
57 | Accepted | 17ms | 3512 KiB | ||||
58 | Runtime error | 16ms | 3276 KiB | ||||
59 | Runtime error | 16ms | 3276 KiB | ||||
60 | Runtime error | 17ms | 3160 KiB | ||||
61 | Runtime error | 16ms | 3128 KiB | ||||
62 | Runtime error | 16ms | 3036 KiB | ||||
63 | Runtime error | 16ms | 3108 KiB | ||||
64 | Runtime error | 16ms | 3016 KiB | ||||
65 | Runtime error | 16ms | 2972 KiB | ||||
66 | Runtime error | 14ms | 3128 KiB |