#include <fstream>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> D(N);
for (int i = 0; i < N; i++) {
cin >> D[i];
}
vector<int> z;
int j;
vector<int> l;
for(int i=0; i<N; i++){
z=D;
j=i;
while(1==1){
if(j==0){
l.push_back((N-1));
break;
}
else if(j==(z.size()-1)){
l.push_back(0);
break;
}
else{
if(z[j+1]-z[j]>=z[j]-z[j-1]){
z.erase( z.begin() + j );
j--;
}
else{
z.erase( z.begin() + j );
}
}
}
}
for (int i=0; i<l.size(); ++i){
cout << l[i] << ' ';
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1680 KiB | ||||
2 | Accepted | 3ms | 1844 KiB | ||||
subtask2 | 12/12 | ||||||
3 | Accepted | 3ms | 2060 KiB | ||||
4 | Accepted | 3ms | 2144 KiB | ||||
5 | Accepted | 3ms | 2276 KiB | ||||
6 | Accepted | 3ms | 2512 KiB | ||||
7 | Accepted | 3ms | 2724 KiB | ||||
8 | Accepted | 3ms | 2884 KiB | ||||
9 | Accepted | 3ms | 3132 KiB | ||||
10 | Accepted | 3ms | 3216 KiB | ||||
11 | Accepted | 3ms | 3312 KiB | ||||
12 | Accepted | 3ms | 3392 KiB | ||||
subtask3 | 0/28 | ||||||
13 | Accepted | 12ms | 3408 KiB | ||||
14 | Accepted | 14ms | 3412 KiB | ||||
15 | Wrong answer | 17ms | 3416 KiB | ||||
16 | Wrong answer | 16ms | 3636 KiB | ||||
17 | Wrong answer | 19ms | 3640 KiB | ||||
18 | Accepted | 14ms | 3768 KiB | ||||
19 | Accepted | 18ms | 3844 KiB | ||||
20 | Wrong answer | 18ms | 3828 KiB | ||||
21 | Wrong answer | 19ms | 3828 KiB | ||||
subtask4 | 0/35 | ||||||
22 | Time limit exceeded | 1.054s | 3800 KiB | ||||
23 | Time limit exceeded | 1.067s | 3852 KiB | ||||
24 | Time limit exceeded | 1.057s | 3992 KiB | ||||
25 | Time limit exceeded | 1.062s | 4092 KiB | ||||
26 | Time limit exceeded | 1.062s | 4064 KiB | ||||
27 | Time limit exceeded | 1.062s | 4448 KiB | ||||
28 | Time limit exceeded | 1.07s | 4488 KiB | ||||
29 | Time limit exceeded | 1.057s | 4528 KiB | ||||
30 | Time limit exceeded | 1.062s | 4372 KiB | ||||
31 | Time limit exceeded | 1.062s | 4712 KiB | ||||
subtask5 | 0/25 | ||||||
32 | Time limit exceeded | 1.082s | 11464 KiB | ||||
33 | Time limit exceeded | 1.049s | 10692 KiB | ||||
34 | Time limit exceeded | 1.07s | 11408 KiB | ||||
35 | Time limit exceeded | 1.07s | 10680 KiB | ||||
36 | Time limit exceeded | 1.069s | 11088 KiB | ||||
37 | Time limit exceeded | 1.052s | 11464 KiB | ||||
38 | Time limit exceeded | 1.059s | 11304 KiB | ||||
39 | Time limit exceeded | 1.083s | 11492 KiB | ||||
40 | Time limit exceeded | 1.047s | 11276 KiB | ||||
41 | Time limit exceeded | 1.072s | 11332 KiB | ||||
42 | Time limit exceeded | 1.065s | 10940 KiB | ||||
43 | Time limit exceeded | 1.062s | 11156 KiB | ||||
44 | Time limit exceeded | 1.05s | 11548 KiB | ||||
45 | Time limit exceeded | 1.065s | 11664 KiB | ||||
46 | Time limit exceeded | 1.049s | 11752 KiB | ||||
47 | Time limit exceeded | 1.049s | 11664 KiB | ||||
48 | Time limit exceeded | 1.054s | 11656 KiB | ||||
49 | Time limit exceeded | 1.047s | 11696 KiB | ||||
50 | Time limit exceeded | 1.052s | 11692 KiB |