80792024-01-12 12:12:47David9320Programtermék verseny (70 pont)cpp17Wrong answer 0/7037ms4552 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

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

    vector<int> pontok(n);
    int helyezes = 1;
    int arany = 0;
    int ezust = 0;
    int bronz = 0;

    for(int i = 0; i < n; i++) {
        cin >> pontok[i];
    }

    for(int i = 0; i < n; i++) {
        if(i == k - 1) {
            continue;
        }
        if(pontok[i] > pontok[k]) {
            helyezes++;
        }
        if(helyezes <= n / 12 && i > k - 1) {
            arany = i + 1;
        } else if(helyezes <= n / 4 && i > k - 1) {
            ezust = i + 1;
        } else if(helyezes <= n / 2 && i > k - 1) {
            bronz = i + 1;
        }
    }

    if(arany == n) {
        cout << "N" << endl;
    } else {
        cout << arany << endl;
    }
    if(ezust == n) {
        cout << "N" << endl;
    } else {
        cout << ezust << endl;
    }
    if(bronz== n) {
        cout << "N" << endl;
    } else {
        cout << bronz << endl;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/70
1Accepted0/03ms1680 KiB
2Wrong answer0/03ms1848 KiB
3Wrong answer0/037ms2916 KiB
4Wrong answer0/33ms2316 KiB
5Wrong answer0/33ms2440 KiB
6Wrong answer0/33ms2928 KiB
7Wrong answer0/33ms2972 KiB
8Wrong answer0/33ms3160 KiB
9Wrong answer0/33ms3164 KiB
10Wrong answer0/33ms3400 KiB
11Wrong answer0/33ms3424 KiB
12Wrong answer0/33ms3432 KiB
13Wrong answer0/34ms3432 KiB
14Wrong answer0/44ms3440 KiB
15Wrong answer0/419ms3608 KiB
16Wrong answer0/423ms3648 KiB
17Wrong answer0/427ms3776 KiB
18Wrong answer0/46ms3592 KiB
19Wrong answer0/48ms3640 KiB
20Wrong answer0/413ms3972 KiB
21Wrong answer0/437ms4552 KiB
22Wrong answer0/437ms4484 KiB
23Wrong answer0/434ms4088 KiB