8526 | 2024-01-21 11:54:30 | BakosCsongor | A Barbár | cpp17 | Wrong answer 0/100 | 3ms | 5000 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("input1.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] << " ";
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 | Wrong answer | 3ms | 1676 KiB | ||||
2 | Wrong answer | 3ms | 1836 KiB | ||||
subtask2 | 0/12 | ||||||
3 | Wrong answer | 3ms | 2120 KiB | ||||
4 | Wrong answer | 3ms | 2376 KiB | ||||
5 | Wrong answer | 3ms | 2544 KiB | ||||
6 | Wrong answer | 3ms | 2708 KiB | ||||
7 | Wrong answer | 3ms | 2784 KiB | ||||
8 | Wrong answer | 3ms | 2828 KiB | ||||
9 | Wrong answer | 3ms | 2852 KiB | ||||
10 | Wrong answer | 3ms | 3084 KiB | ||||
11 | Wrong answer | 3ms | 3236 KiB | ||||
12 | Wrong answer | 3ms | 3504 KiB | ||||
subtask3 | 0/28 | ||||||
13 | Wrong answer | 3ms | 3664 KiB | ||||
14 | Wrong answer | 3ms | 3644 KiB | ||||
15 | Wrong answer | 3ms | 3648 KiB | ||||
16 | Wrong answer | 2ms | 3648 KiB | ||||
17 | Wrong answer | 2ms | 3644 KiB | ||||
18 | Wrong answer | 3ms | 3648 KiB | ||||
19 | Wrong answer | 3ms | 3648 KiB | ||||
20 | Wrong answer | 3ms | 3648 KiB | ||||
21 | Wrong answer | 3ms | 3872 KiB | ||||
subtask4 | 0/35 | ||||||
22 | Wrong answer | 3ms | 3860 KiB | ||||
23 | Wrong answer | 3ms | 3860 KiB | ||||
24 | Wrong answer | 3ms | 3988 KiB | ||||
25 | Wrong answer | 3ms | 4084 KiB | ||||
26 | Wrong answer | 3ms | 3976 KiB | ||||
27 | Wrong answer | 3ms | 3972 KiB | ||||
28 | Wrong answer | 3ms | 4028 KiB | ||||
29 | Wrong answer | 3ms | 4152 KiB | ||||
30 | Wrong answer | 3ms | 4284 KiB | ||||
31 | Wrong answer | 3ms | 4408 KiB | ||||
subtask5 | 0/25 | ||||||
32 | Wrong answer | 3ms | 4452 KiB | ||||
33 | Wrong answer | 3ms | 4704 KiB | ||||
34 | Wrong answer | 3ms | 4536 KiB | ||||
35 | Wrong answer | 3ms | 4428 KiB | ||||
36 | Wrong answer | 3ms | 4428 KiB | ||||
37 | Wrong answer | 3ms | 4428 KiB | ||||
38 | Wrong answer | 3ms | 4424 KiB | ||||
39 | Wrong answer | 3ms | 4424 KiB | ||||
40 | Wrong answer | 3ms | 4432 KiB | ||||
41 | Wrong answer | 3ms | 4660 KiB | ||||
42 | Wrong answer | 3ms | 4636 KiB | ||||
43 | Wrong answer | 3ms | 4740 KiB | ||||
44 | Wrong answer | 3ms | 4756 KiB | ||||
45 | Wrong answer | 3ms | 4872 KiB | ||||
46 | Wrong answer | 3ms | 5000 KiB | ||||
47 | Wrong answer | 3ms | 4848 KiB | ||||
48 | Wrong answer | 3ms | 4852 KiB | ||||
49 | Wrong answer | 2ms | 4848 KiB | ||||
50 | Wrong answer | 3ms | 4852 KiB |