85262024-01-21 11:54:30BakosCsongorA Barbárcpp17Wrong answer 0/1003ms5000 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1676 KiB
2Wrong answer3ms1836 KiB
subtask20/12
3Wrong answer3ms2120 KiB
4Wrong answer3ms2376 KiB
5Wrong answer3ms2544 KiB
6Wrong answer3ms2708 KiB
7Wrong answer3ms2784 KiB
8Wrong answer3ms2828 KiB
9Wrong answer3ms2852 KiB
10Wrong answer3ms3084 KiB
11Wrong answer3ms3236 KiB
12Wrong answer3ms3504 KiB
subtask30/28
13Wrong answer3ms3664 KiB
14Wrong answer3ms3644 KiB
15Wrong answer3ms3648 KiB
16Wrong answer2ms3648 KiB
17Wrong answer2ms3644 KiB
18Wrong answer3ms3648 KiB
19Wrong answer3ms3648 KiB
20Wrong answer3ms3648 KiB
21Wrong answer3ms3872 KiB
subtask40/35
22Wrong answer3ms3860 KiB
23Wrong answer3ms3860 KiB
24Wrong answer3ms3988 KiB
25Wrong answer3ms4084 KiB
26Wrong answer3ms3976 KiB
27Wrong answer3ms3972 KiB
28Wrong answer3ms4028 KiB
29Wrong answer3ms4152 KiB
30Wrong answer3ms4284 KiB
31Wrong answer3ms4408 KiB
subtask50/25
32Wrong answer3ms4452 KiB
33Wrong answer3ms4704 KiB
34Wrong answer3ms4536 KiB
35Wrong answer3ms4428 KiB
36Wrong answer3ms4428 KiB
37Wrong answer3ms4428 KiB
38Wrong answer3ms4424 KiB
39Wrong answer3ms4424 KiB
40Wrong answer3ms4432 KiB
41Wrong answer3ms4660 KiB
42Wrong answer3ms4636 KiB
43Wrong answer3ms4740 KiB
44Wrong answer3ms4756 KiB
45Wrong answer3ms4872 KiB
46Wrong answer3ms5000 KiB
47Wrong answer3ms4848 KiB
48Wrong answer3ms4852 KiB
49Wrong answer2ms4848 KiB
50Wrong answer3ms4852 KiB