40482023-03-10 22:10:28xxxProgramtermék verseny (70 pont)cpp14Wrong answer 67/7037ms4996 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
2Accepted0/03ms2280 KiB
3Accepted0/037ms3120 KiB
4Accepted3/33ms2592 KiB
5Accepted3/32ms2796 KiB
6Wrong answer0/32ms2888 KiB
7Accepted3/33ms2836 KiB
8Accepted3/33ms3056 KiB
9Accepted3/33ms3328 KiB
10Accepted3/33ms3344 KiB
11Accepted3/33ms3344 KiB
12Accepted3/33ms3332 KiB
13Accepted3/33ms3440 KiB
14Accepted4/44ms3652 KiB
15Accepted4/419ms4048 KiB
16Accepted4/424ms4272 KiB
17Accepted4/427ms4396 KiB
18Accepted4/46ms3908 KiB
19Accepted4/48ms4200 KiB
20Accepted4/413ms4192 KiB
21Accepted4/437ms4852 KiB
22Accepted4/437ms4996 KiB
23Accepted4/434ms4764 KiB