86912024-01-25 12:24:14BakosCsongorA Barbárcpp17Wrong answer 0/1003ms4864 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] << " ";
            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 answer3ms1808 KiB
2Wrong answer3ms2000 KiB
subtask20/12
3Wrong answer2ms1980 KiB
4Wrong answer3ms2212 KiB
5Wrong answer3ms2468 KiB
6Wrong answer3ms2584 KiB
7Wrong answer2ms2612 KiB
8Wrong answer3ms2856 KiB
9Wrong answer3ms3068 KiB
10Wrong answer3ms3160 KiB
11Wrong answer3ms3416 KiB
12Wrong answer2ms3460 KiB
subtask30/28
13Wrong answer3ms3708 KiB
14Wrong answer3ms3608 KiB
15Wrong answer2ms3608 KiB
16Wrong answer3ms3572 KiB
17Wrong answer2ms3576 KiB
18Wrong answer3ms3800 KiB
19Wrong answer2ms3832 KiB
20Wrong answer3ms3784 KiB
21Wrong answer2ms3784 KiB
subtask40/35
22Wrong answer2ms3784 KiB
23Wrong answer2ms3880 KiB
24Wrong answer3ms3792 KiB
25Wrong answer3ms3892 KiB
26Wrong answer3ms4020 KiB
27Wrong answer3ms4140 KiB
28Wrong answer3ms4404 KiB
29Wrong answer3ms4308 KiB
30Wrong answer3ms4264 KiB
31Wrong answer3ms4264 KiB
subtask50/25
32Wrong answer2ms4368 KiB
33Wrong answer3ms4336 KiB
34Wrong answer3ms4216 KiB
35Wrong answer2ms4216 KiB
36Wrong answer3ms4444 KiB
37Wrong answer3ms4532 KiB
38Wrong answer2ms4532 KiB
39Wrong answer2ms4428 KiB
40Wrong answer2ms4428 KiB
41Wrong answer2ms4428 KiB
42Wrong answer3ms4424 KiB
43Wrong answer3ms4428 KiB
44Wrong answer3ms4428 KiB
45Wrong answer3ms4424 KiB
46Wrong answer3ms4660 KiB
47Wrong answer2ms4644 KiB
48Wrong answer3ms4640 KiB
49Wrong answer3ms4640 KiB
50Wrong answer3ms4864 KiB