85632024-01-21 23:19:15baktucsokA Barbárcpp14Wrong answer 12/1001.083s11752 KiB
#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;
    
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1680 KiB
2Accepted3ms1844 KiB
subtask212/12
3Accepted3ms2060 KiB
4Accepted3ms2144 KiB
5Accepted3ms2276 KiB
6Accepted3ms2512 KiB
7Accepted3ms2724 KiB
8Accepted3ms2884 KiB
9Accepted3ms3132 KiB
10Accepted3ms3216 KiB
11Accepted3ms3312 KiB
12Accepted3ms3392 KiB
subtask30/28
13Accepted12ms3408 KiB
14Accepted14ms3412 KiB
15Wrong answer17ms3416 KiB
16Wrong answer16ms3636 KiB
17Wrong answer19ms3640 KiB
18Accepted14ms3768 KiB
19Accepted18ms3844 KiB
20Wrong answer18ms3828 KiB
21Wrong answer19ms3828 KiB
subtask40/35
22Time limit exceeded1.054s3800 KiB
23Time limit exceeded1.067s3852 KiB
24Time limit exceeded1.057s3992 KiB
25Time limit exceeded1.062s4092 KiB
26Time limit exceeded1.062s4064 KiB
27Time limit exceeded1.062s4448 KiB
28Time limit exceeded1.07s4488 KiB
29Time limit exceeded1.057s4528 KiB
30Time limit exceeded1.062s4372 KiB
31Time limit exceeded1.062s4712 KiB
subtask50/25
32Time limit exceeded1.082s11464 KiB
33Time limit exceeded1.049s10692 KiB
34Time limit exceeded1.07s11408 KiB
35Time limit exceeded1.07s10680 KiB
36Time limit exceeded1.069s11088 KiB
37Time limit exceeded1.052s11464 KiB
38Time limit exceeded1.059s11304 KiB
39Time limit exceeded1.083s11492 KiB
40Time limit exceeded1.047s11276 KiB
41Time limit exceeded1.072s11332 KiB
42Time limit exceeded1.065s10940 KiB
43Time limit exceeded1.062s11156 KiB
44Time limit exceeded1.05s11548 KiB
45Time limit exceeded1.065s11664 KiB
46Time limit exceeded1.049s11752 KiB
47Time limit exceeded1.049s11664 KiB
48Time limit exceeded1.054s11656 KiB
49Time limit exceeded1.047s11696 KiB
50Time limit exceeded1.052s11692 KiB