75662024-01-09 17:50:36AblablablaProgramtermék verseny (70 pont)cpp17Accepted 70/7037ms4700 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;

    vector<int> pontok(n, 0);
    for(int i = 0; i < n; i++){
        cin >> pontok[i];
    }
    vector<int> helyek(3, 0);
    helyek[0] = n / 12;
    helyek[1] = n / 4;
    helyek[2] = n / 2;

    int bendeguz = pontok[k - 1];
    int helyezes = 1;
    int ind = 0;
    for(int i = 0; i < k - 1; i++){
        if(pontok[i] > bendeguz){
            helyezes++;
        }
    }

    while(ind < 3 && helyek[ind] < helyezes){
        cout << "0\n";
        ind++;
    }

    for(int i = k; i < n; i++){
        if(pontok[i] > bendeguz){
            helyezes++;
        }

        if(ind < 3 && helyek[ind] < helyezes){
            cout << i << "\n";
            ind++;
        }
    }

    if(ind < 3){
        cout << n << "\n";
        ind++;
        while(ind < 3){
            cout << "0\n";
            ind++;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base70/70
1Accepted0/03ms1956 KiB
2Accepted0/03ms2208 KiB
3Accepted0/037ms3128 KiB
4Accepted3/33ms2512 KiB
5Accepted3/33ms2672 KiB
6Accepted3/33ms2840 KiB
7Accepted3/33ms2924 KiB
8Accepted3/33ms3048 KiB
9Accepted3/33ms3056 KiB
10Accepted3/33ms3288 KiB
11Accepted3/33ms3360 KiB
12Accepted3/33ms3572 KiB
13Accepted3/33ms3572 KiB
14Accepted4/44ms3724 KiB
15Accepted4/419ms3988 KiB
16Accepted4/423ms3968 KiB
17Accepted4/427ms4368 KiB
18Accepted4/46ms4060 KiB
19Accepted4/48ms4068 KiB
20Accepted4/412ms4108 KiB
21Accepted4/437ms4696 KiB
22Accepted4/437ms4700 KiB
23Accepted4/432ms4668 KiB