85622024-01-21 23:12:19baktucsokA Barbárcpp17Wrong answer 12/1001.1s12224 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
1Accepted3ms1808 KiB
2Accepted3ms2060 KiB
subtask212/12
3Accepted3ms2276 KiB
4Accepted3ms2512 KiB
5Accepted3ms2700 KiB
6Accepted3ms2728 KiB
7Accepted3ms2960 KiB
8Accepted3ms3172 KiB
9Accepted3ms3308 KiB
10Accepted3ms3360 KiB
11Accepted3ms3488 KiB
12Accepted3ms3572 KiB
subtask30/28
13Accepted12ms3696 KiB
14Accepted14ms3940 KiB
15Wrong answer17ms3944 KiB
16Wrong answer16ms4032 KiB
17Wrong answer19ms4236 KiB
18Accepted14ms4320 KiB
19Accepted18ms4572 KiB
20Wrong answer18ms4328 KiB
21Wrong answer19ms4376 KiB
subtask40/35
22Time limit exceeded1.1s4260 KiB
23Time limit exceeded1.07s4384 KiB
24Time limit exceeded1.075s4504 KiB
25Time limit exceeded1.065s4628 KiB
26Time limit exceeded1.065s4028 KiB
27Time limit exceeded1.062s4536 KiB
28Time limit exceeded1.065s4728 KiB
29Time limit exceeded1.069s4792 KiB
30Time limit exceeded1.062s4960 KiB
31Time limit exceeded1.059s4772 KiB
subtask50/25
32Time limit exceeded1.1s11724 KiB
33Time limit exceeded1.074s10944 KiB
34Time limit exceeded1.074s11860 KiB
35Time limit exceeded1.082s11452 KiB
36Time limit exceeded1.034s11828 KiB
37Time limit exceeded1.077s12124 KiB
38Time limit exceeded1.05s11932 KiB
39Time limit exceeded1.072s12120 KiB
40Time limit exceeded1.06s12148 KiB
41Time limit exceeded1.019s12156 KiB
42Time limit exceeded1.052s11700 KiB
43Time limit exceeded1.075s12084 KiB
44Time limit exceeded1.08s12168 KiB
45Time limit exceeded1.046s12076 KiB
46Time limit exceeded1.069s12096 KiB
47Time limit exceeded1.069s12116 KiB
48Time limit exceeded1.07s12140 KiB
49Time limit exceeded1.059s12224 KiB
50Time limit exceeded1.067s12172 KiB