8692 | 2024-01-25 12:30:41 | BakosCsongor | A Barbár | cpp17 | Wrong answer 12/100 | 1.082s | 37700 KiB |
// insert brief description of the solution here
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<array<int,2>> v;
vector<array<int,2>> v_original;
vector<array<int,2>>::iterator it;
// uncomment the following lines if you want to read/write from files
//ifstream cin("input0.txt");
int N;
cin >> N;
for(int i = 0; i < N; i++){
int x;
cin >> x;
v.push_back({x,i});
v_original.push_back({x,i});
}
it = v.begin();
for(int i = 0; i < N; i++){
int actual = i;
for(int j = 0; j < N; j++){
if(v.size() == 1)
cout << v.at(0)[1] << "\t";
else if(actual == 0){
v.erase(it + (actual));
}
else if(actual == (v.size() - 1)){
actual--;
v.erase(it + (actual+1));
}
else if((v.at(actual)[0] - v.at(actual-1)[0]) < (v.at(actual+1)[0] - v.at(actual)[0])){
actual--;
v.erase(it + (actual+1));
}
else if((v.at(actual)[0] - v.at(actual-1)[0]) > (v.at(actual+1)[0] - v.at(actual)[0])){
v.erase(it + (actual));
}
else{
actual--;
v.erase(it + (actual+1));
}
}
v.clear();
for(int i=0; i<v_original.size(); i++){
v.push_back({v_original.at(i)[0], v_original.at(i)[1]});
}
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1812 KiB | ||||
2 | Accepted | 3ms | 2056 KiB | ||||
subtask2 | 12/12 | ||||||
3 | Accepted | 3ms | 2224 KiB | ||||
4 | Accepted | 3ms | 2436 KiB | ||||
5 | Accepted | 3ms | 2712 KiB | ||||
6 | Accepted | 3ms | 2836 KiB | ||||
7 | Accepted | 3ms | 3004 KiB | ||||
8 | Accepted | 3ms | 3000 KiB | ||||
9 | Accepted | 3ms | 3056 KiB | ||||
10 | Accepted | 3ms | 3304 KiB | ||||
11 | Accepted | 3ms | 3296 KiB | ||||
12 | Accepted | 3ms | 3460 KiB | ||||
subtask3 | 0/28 | ||||||
13 | Accepted | 32ms | 3568 KiB | ||||
14 | Accepted | 43ms | 3532 KiB | ||||
15 | Wrong answer | 54ms | 3548 KiB | ||||
16 | Wrong answer | 54ms | 3556 KiB | ||||
17 | Wrong answer | 71ms | 3908 KiB | ||||
18 | Accepted | 46ms | 4004 KiB | ||||
19 | Accepted | 68ms | 3920 KiB | ||||
20 | Wrong answer | 68ms | 3928 KiB | ||||
21 | Wrong answer | 71ms | 4148 KiB | ||||
subtask4 | 0/35 | ||||||
22 | Time limit exceeded | 1.065s | 5876 KiB | ||||
23 | Time limit exceeded | 1.052s | 6572 KiB | ||||
24 | Time limit exceeded | 1.072s | 7580 KiB | ||||
25 | Time limit exceeded | 1.065s | 8288 KiB | ||||
26 | Time limit exceeded | 1.044s | 8168 KiB | ||||
27 | Time limit exceeded | 1.072s | 9248 KiB | ||||
28 | Time limit exceeded | 1.065s | 9896 KiB | ||||
29 | Time limit exceeded | 1.074s | 10404 KiB | ||||
30 | Time limit exceeded | 1.077s | 10624 KiB | ||||
31 | Time limit exceeded | 1.074s | 10560 KiB | ||||
subtask5 | 0/25 | ||||||
32 | Time limit exceeded | 1.082s | 24472 KiB | ||||
33 | Time limit exceeded | 1.062s | 22940 KiB | ||||
34 | Time limit exceeded | 1.062s | 24764 KiB | ||||
35 | Time limit exceeded | 1.062s | 23280 KiB | ||||
36 | Time limit exceeded | 1.074s | 24412 KiB | ||||
37 | Time limit exceeded | 1.049s | 24964 KiB | ||||
38 | Time limit exceeded | 1.082s | 24680 KiB | ||||
39 | Time limit exceeded | 1.06s | 24940 KiB | ||||
40 | Time limit exceeded | 1.075s | 24860 KiB | ||||
41 | Time limit exceeded | 1.078s | 24976 KiB | ||||
42 | Time limit exceeded | 1.077s | 26360 KiB | ||||
43 | Time limit exceeded | 1.062s | 35928 KiB | ||||
44 | Time limit exceeded | 1.065s | 37400 KiB | ||||
45 | Time limit exceeded | 1.08s | 37524 KiB | ||||
46 | Time limit exceeded | 1.044s | 37584 KiB | ||||
47 | Time limit exceeded | 1.062s | 37668 KiB | ||||
48 | Time limit exceeded | 1.074s | 37604 KiB | ||||
49 | Time limit exceeded | 1.059s | 37600 KiB | ||||
50 | Time limit exceeded | 1.062s | 37700 KiB |