11600 | 2024-10-29 22:48:25 | Kezdő | Számjegycsere | python3 | Wrong answer 0/100 | 555ms | 3568 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 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 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 173ms | 3128 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 509ms | 3408 KiB | ||||
4 | Wrong answer | 500ms | 3384 KiB | ||||
5 | Wrong answer | 488ms | 3384 KiB | ||||
6 | Wrong answer | 510ms | 3380 KiB | ||||
7 | Wrong answer | 508ms | 3244 KiB | ||||
8 | Wrong answer | 515ms | 3164 KiB | ||||
9 | Wrong answer | 508ms | 3408 KiB | ||||
10 | Wrong answer | 522ms | 3404 KiB | ||||
11 | Wrong answer | 499ms | 3384 KiB | ||||
12 | Wrong answer | 497ms | 3416 KiB | ||||
13 | Accepted | 492ms | 3420 KiB | ||||
14 | Wrong answer | 497ms | 3220 KiB | ||||
15 | Wrong answer | 500ms | 3384 KiB | ||||
16 | Wrong answer | 488ms | 3384 KiB | ||||
17 | Wrong answer | 493ms | 3388 KiB | ||||
18 | Wrong answer | 497ms | 3396 KiB | ||||
19 | Accepted | 483ms | 3416 KiB | ||||
20 | Accepted | 504ms | 3412 KiB | ||||
21 | Wrong answer | 549ms | 3320 KiB | ||||
22 | Wrong answer | 510ms | 3384 KiB | ||||
23 | Wrong answer | 479ms | 3384 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 17ms | 3072 KiB | ||||
25 | Accepted | 16ms | 3380 KiB | ||||
26 | Accepted | 17ms | 3024 KiB | ||||
27 | Accepted | 16ms | 3132 KiB | ||||
28 | Accepted | 16ms | 2988 KiB | ||||
29 | Accepted | 17ms | 3096 KiB | ||||
30 | Accepted | 16ms | 2948 KiB | ||||
31 | Accepted | 16ms | 3128 KiB | ||||
32 | Accepted | 16ms | 3076 KiB | ||||
33 | Accepted | 16ms | 3128 KiB | ||||
34 | Accepted | 17ms | 3128 KiB | ||||
35 | Accepted | 17ms | 3124 KiB | ||||
36 | Accepted | 21ms | 3060 KiB | ||||
37 | Accepted | 57ms | 3048 KiB | ||||
38 | Accepted | 16ms | 3132 KiB | ||||
39 | Accepted | 16ms | 3044 KiB | ||||
40 | Accepted | 16ms | 3068 KiB | ||||
41 | Accepted | 16ms | 3008 KiB | ||||
42 | Accepted | 20ms | 3080 KiB | ||||
43 | Accepted | 19ms | 3076 KiB | ||||
44 | Accepted | 19ms | 3120 KiB | ||||
45 | Accepted | 20ms | 3140 KiB | ||||
46 | Accepted | 16ms | 3132 KiB | ||||
47 | Wrong answer | 19ms | 3128 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Accepted | 24ms | 3128 KiB | ||||
49 | Accepted | 18ms | 3560 KiB | ||||
50 | Wrong answer | 490ms | 3320 KiB | ||||
51 | Accepted | 20ms | 3124 KiB | ||||
52 | Wrong answer | 114ms | 3128 KiB | ||||
53 | Accepted | 17ms | 3072 KiB | ||||
54 | Accepted | 24ms | 3172 KiB | ||||
55 | Accepted | 65ms | 3216 KiB | ||||
56 | Accepted | 555ms | 3372 KiB | ||||
57 | Accepted | 18ms | 3568 KiB | ||||
58 | Accepted | 17ms | 3472 KiB | ||||
59 | Accepted | 17ms | 3460 KiB | ||||
60 | Accepted | 21ms | 3156 KiB | ||||
61 | Accepted | 21ms | 3168 KiB | ||||
62 | Accepted | 21ms | 3180 KiB | ||||
63 | Accepted | 21ms | 3128 KiB | ||||
64 | Accepted | 495ms | 3420 KiB | ||||
65 | Accepted | 497ms | 3340 KiB | ||||
66 | Accepted | 485ms | 3384 KiB |