75752024-01-09 19:47:57xxxProgramtermék verseny (70 pont)cpp17Wrong answer 67/7037ms4844 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    k -= 1;
    int ar = (n / 12), e = (n / 4), b = (n / 2);
    int a[n];
    int beni;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (i == k) {
            beni = a[i];
        }
    }

    int tobb = 0;
    int ans[3] = {0};
    for (int i = 0; i < n; i++) {
        if (i >= k) {
            if (tobb == ar  && ans[0] == 0) {
                ans[0] = i - 1;
            }
            else if (tobb == e && ans[1] == 0) {
                ans[1] = i - 1;
            }
            else if (tobb == b && ans[2] == 0) {
                ans[2] = i - 1;
            }
        }
        if (a[i] > beni) {
            tobb++;
        }
    }

    if (tobb < ar) {
        ans[0] = n;
    }
    else if (tobb < e) {
        ans[1] = n;
    }
    else if (tobb < b) {
        ans[2] = n;
    }

    for (int i = 0; i < 3; i++) {
        cout << ans[i] << endl;
    }



    return 0;
}
SubtaskSumTestVerdictTimeMemory
base67/70
1Accepted0/03ms1872 KiB
2Wrong answer0/03ms2124 KiB
3Accepted0/037ms3104 KiB
4Accepted3/33ms2504 KiB
5Accepted3/33ms2748 KiB
6Wrong answer0/33ms2956 KiB
7Accepted3/33ms3160 KiB
8Accepted3/32ms3280 KiB
9Accepted3/32ms3368 KiB
10Accepted3/33ms3368 KiB
11Accepted3/33ms3248 KiB
12Accepted3/33ms3380 KiB
13Accepted3/33ms3632 KiB
14Accepted4/44ms3780 KiB
15Accepted4/419ms4424 KiB
16Accepted4/423ms4660 KiB
17Accepted4/427ms4804 KiB
18Accepted4/46ms4316 KiB
19Accepted4/48ms4308 KiB
20Accepted4/413ms4172 KiB
21Accepted4/437ms4828 KiB
22Accepted4/437ms4844 KiB
23Accepted4/434ms4664 KiB