85612024-01-21 23:00:15baktucsokA Barbárcpp17Wrong answer 12/1001.1s12084 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
1Accepted3ms1684 KiB
2Accepted3ms1932 KiB
subtask212/12
3Accepted3ms2168 KiB
4Accepted2ms2248 KiB
5Accepted3ms2380 KiB
6Accepted3ms2628 KiB
7Accepted3ms2984 KiB
8Accepted3ms3032 KiB
9Accepted3ms3116 KiB
10Accepted3ms3124 KiB
11Accepted3ms3268 KiB
12Accepted3ms3240 KiB
subtask30/28
13Accepted12ms3280 KiB
14Accepted14ms3224 KiB
15Wrong answer17ms3356 KiB
16Wrong answer16ms3712 KiB
17Wrong answer19ms3584 KiB
18Accepted14ms3584 KiB
19Accepted18ms3584 KiB
20Wrong answer18ms3688 KiB
21Wrong answer19ms3912 KiB
subtask40/35
22Time limit exceeded1.1s4092 KiB
23Time limit exceeded1.054s4184 KiB
24Time limit exceeded1.082s4264 KiB
25Time limit exceeded1.062s4268 KiB
26Time limit exceeded1.054s3864 KiB
27Time limit exceeded1.082s4388 KiB
28Time limit exceeded1.062s4744 KiB
29Time limit exceeded1.065s4456 KiB
30Time limit exceeded1.062s4400 KiB
31Time limit exceeded1.082s4724 KiB
subtask50/25
32Time limit exceeded1.062s11860 KiB
33Time limit exceeded1.072s11040 KiB
34Time limit exceeded1.052s11840 KiB
35Time limit exceeded1.057s11012 KiB
36Time limit exceeded1.069s11756 KiB
37Time limit exceeded1.072s11992 KiB
38Time limit exceeded1.062s11736 KiB
39Time limit exceeded1.078s11928 KiB
40Time limit exceeded1.059s12084 KiB
41Time limit exceeded1.067s11996 KiB
42Time limit exceeded1.062s11604 KiB
43Time limit exceeded1.075s11860 KiB
44Time limit exceeded1.075s11872 KiB
45Time limit exceeded1.1s11844 KiB
46Time limit exceeded1.065s11952 KiB
47Time limit exceeded1.057s12028 KiB
48Time limit exceeded1.067s12036 KiB
49Time limit exceeded1.1s11996 KiB
50Time limit exceeded1.064s11884 KiB