80752024-01-12 12:06:24David9320Programtermék verseny (70 pont)cpp17Wrong answer 0/7037ms3968 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) {
            arany = i + 1;
        } else if(helyezes <= n / 4) {
            ezust = i + 1;
        } else if(helyezes <= n / 2) {
            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/03ms1816 KiB
2Wrong answer0/03ms2288 KiB
3Wrong answer0/037ms3124 KiB
4Wrong answer0/33ms2428 KiB
5Wrong answer0/33ms2504 KiB
6Wrong answer0/33ms2616 KiB
7Wrong answer0/33ms2756 KiB
8Wrong answer0/33ms2892 KiB
9Wrong answer0/32ms2996 KiB
10Wrong answer0/33ms2976 KiB
11Wrong answer0/33ms2976 KiB
12Wrong answer0/33ms2980 KiB
13Wrong answer0/33ms2988 KiB
14Wrong answer0/44ms2992 KiB
15Wrong answer0/419ms3272 KiB
16Wrong answer0/423ms3328 KiB
17Wrong answer0/427ms3544 KiB
18Wrong answer0/46ms3380 KiB
19Wrong answer0/48ms3332 KiB
20Wrong answer0/412ms3372 KiB
21Wrong answer0/437ms3968 KiB
22Wrong answer0/437ms3968 KiB
23Wrong answer0/434ms3568 KiB