#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 | 1808 KiB | ||||
2 | Accepted | 3ms | 2060 KiB | ||||
subtask2 | 12/12 | ||||||
3 | Accepted | 3ms | 2276 KiB | ||||
4 | Accepted | 3ms | 2512 KiB | ||||
5 | Accepted | 3ms | 2700 KiB | ||||
6 | Accepted | 3ms | 2728 KiB | ||||
7 | Accepted | 3ms | 2960 KiB | ||||
8 | Accepted | 3ms | 3172 KiB | ||||
9 | Accepted | 3ms | 3308 KiB | ||||
10 | Accepted | 3ms | 3360 KiB | ||||
11 | Accepted | 3ms | 3488 KiB | ||||
12 | Accepted | 3ms | 3572 KiB | ||||
subtask3 | 0/28 | ||||||
13 | Accepted | 12ms | 3696 KiB | ||||
14 | Accepted | 14ms | 3940 KiB | ||||
15 | Wrong answer | 17ms | 3944 KiB | ||||
16 | Wrong answer | 16ms | 4032 KiB | ||||
17 | Wrong answer | 19ms | 4236 KiB | ||||
18 | Accepted | 14ms | 4320 KiB | ||||
19 | Accepted | 18ms | 4572 KiB | ||||
20 | Wrong answer | 18ms | 4328 KiB | ||||
21 | Wrong answer | 19ms | 4376 KiB | ||||
subtask4 | 0/35 | ||||||
22 | Time limit exceeded | 1.1s | 4260 KiB | ||||
23 | Time limit exceeded | 1.07s | 4384 KiB | ||||
24 | Time limit exceeded | 1.075s | 4504 KiB | ||||
25 | Time limit exceeded | 1.065s | 4628 KiB | ||||
26 | Time limit exceeded | 1.065s | 4028 KiB | ||||
27 | Time limit exceeded | 1.062s | 4536 KiB | ||||
28 | Time limit exceeded | 1.065s | 4728 KiB | ||||
29 | Time limit exceeded | 1.069s | 4792 KiB | ||||
30 | Time limit exceeded | 1.062s | 4960 KiB | ||||
31 | Time limit exceeded | 1.059s | 4772 KiB | ||||
subtask5 | 0/25 | ||||||
32 | Time limit exceeded | 1.1s | 11724 KiB | ||||
33 | Time limit exceeded | 1.074s | 10944 KiB | ||||
34 | Time limit exceeded | 1.074s | 11860 KiB | ||||
35 | Time limit exceeded | 1.082s | 11452 KiB | ||||
36 | Time limit exceeded | 1.034s | 11828 KiB | ||||
37 | Time limit exceeded | 1.077s | 12124 KiB | ||||
38 | Time limit exceeded | 1.05s | 11932 KiB | ||||
39 | Time limit exceeded | 1.072s | 12120 KiB | ||||
40 | Time limit exceeded | 1.06s | 12148 KiB | ||||
41 | Time limit exceeded | 1.019s | 12156 KiB | ||||
42 | Time limit exceeded | 1.052s | 11700 KiB | ||||
43 | Time limit exceeded | 1.075s | 12084 KiB | ||||
44 | Time limit exceeded | 1.08s | 12168 KiB | ||||
45 | Time limit exceeded | 1.046s | 12076 KiB | ||||
46 | Time limit exceeded | 1.069s | 12096 KiB | ||||
47 | Time limit exceeded | 1.069s | 12116 KiB | ||||
48 | Time limit exceeded | 1.07s | 12140 KiB | ||||
49 | Time limit exceeded | 1.059s | 12224 KiB | ||||
50 | Time limit exceeded | 1.067s | 12172 KiB |