N = int(input().strip())
D = list(map(int, input().strip().split()))
l = []
z=D
for i in range(N):
D=list(z)
while True:
if i ==0:
l.append(str(N-1))
break
elif i == (len(D)-1):
l.append("0")
break
else:
if D[i+1]-D[i]>=D[i]-D[i-1]:
D.remove(D[i])
i-=1
else:
D.remove(D[i])
print(" ".join(l))
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11348 KiB | ||||
2 | Accepted | 17ms | 11120 KiB | ||||
subtask2 | 12/12 | ||||||
3 | Accepted | 17ms | 11716 KiB | ||||
4 | Accepted | 17ms | 11932 KiB | ||||
5 | Accepted | 17ms | 12164 KiB | ||||
6 | Accepted | 24ms | 11928 KiB | ||||
7 | Accepted | 24ms | 12396 KiB | ||||
8 | Accepted | 25ms | 12448 KiB | ||||
9 | Accepted | 24ms | 12624 KiB | ||||
10 | Accepted | 24ms | 12864 KiB | ||||
11 | Accepted | 23ms | 12664 KiB | ||||
12 | Accepted | 25ms | 12612 KiB | ||||
subtask3 | 0/28 | ||||||
13 | Time limit exceeded | 1.064s | 5372 KiB | ||||
14 | Time limit exceeded | 1.062s | 5396 KiB | ||||
15 | Time limit exceeded | 1.067s | 5376 KiB | ||||
16 | Time limit exceeded | 1.059s | 5384 KiB | ||||
17 | Time limit exceeded | 1.075s | 5400 KiB | ||||
18 | Time limit exceeded | 1.067s | 5512 KiB | ||||
19 | Time limit exceeded | 1.072s | 5644 KiB | ||||
20 | Time limit exceeded | 1.075s | 5648 KiB | ||||
21 | Time limit exceeded | 1.075s | 5952 KiB | ||||
subtask4 | 0/35 | ||||||
22 | Time limit exceeded | 1.075s | 16888 KiB | ||||
23 | Time limit exceeded | 1.06s | 17000 KiB | ||||
24 | Time limit exceeded | 1.075s | 16888 KiB | ||||
25 | Time limit exceeded | 1.039s | 16956 KiB | ||||
26 | Time limit exceeded | 1.075s | 12428 KiB | ||||
27 | Time limit exceeded | 1.069s | 17852 KiB | ||||
28 | Time limit exceeded | 1.08s | 17764 KiB | ||||
29 | Time limit exceeded | 1.047s | 17772 KiB | ||||
30 | Time limit exceeded | 1.077s | 17612 KiB | ||||
31 | Time limit exceeded | 1.08s | 17180 KiB | ||||
subtask5 | 0/25 | ||||||
32 | Time limit exceeded | 1.057s | 116564 KiB | ||||
33 | Time limit exceeded | 1.067s | 105576 KiB | ||||
34 | Time limit exceeded | 1.062s | 125816 KiB | ||||
35 | Time limit exceeded | 1.065s | 105536 KiB | ||||
36 | Time limit exceeded | 1.06s | 118148 KiB | ||||
37 | Time limit exceeded | 1.074s | 123908 KiB | ||||
38 | Time limit exceeded | 1.074s | 127080 KiB | ||||
39 | Time limit exceeded | 1.054s | 129932 KiB | ||||
40 | Time limit exceeded | 1.074s | 130032 KiB | ||||
41 | Time limit exceeded | 1.054s | 122496 KiB | ||||
42 | Time limit exceeded | 1.077s | 112532 KiB | ||||
43 | Time limit exceeded | 1.062s | 114928 KiB | ||||
44 | Time limit exceeded | 1.075s | 122392 KiB | ||||
45 | Time limit exceeded | 1.085s | 116036 KiB | ||||
46 | Time limit exceeded | 1.067s | 121860 KiB | ||||
47 | Time limit exceeded | 1.088s | 116536 KiB | ||||
48 | Time limit exceeded | 1.062s | 116608 KiB | ||||
49 | Time limit exceeded | 1.062s | 116564 KiB | ||||
50 | Time limit exceeded | 1.046s | 116652 KiB |