220062026-01-14 12:37:30sandormeszicsFasor (40)cpp11Wrong answer 8/40300ms1164 KiB
#include <iostream>

using namespace std;

int boldog(int a[200000], int n, int k){
    for(int i = k; i < n-k; i++){
            bool b = true;
            for(int j = 0; j < k; j++){
                if(a[i] < a[i-j-1] || a[i] < a[i+j+1]){
                    b = false;
                }
            }
            if(b){
                return i+1;
            }
        }

    return -1;
}

int main()
{
    int a[200000], n, k;
    cin >> n >> k;

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

    cout << boldog(a, n, k);


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/40
1Accepted0/01ms508 KiB
2Accepted0/04ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/21ms388 KiB
8Accepted2/22ms344 KiB
9Wrong answer0/24ms316 KiB
10Accepted2/24ms316 KiB
11Accepted2/24ms316 KiB
12Wrong answer0/23ms316 KiB
13Time limit exceeded0/2300ms720 KiB
14Wrong answer0/232ms564 KiB
15Time limit exceeded0/2300ms1164 KiB
16Time limit exceeded0/2300ms1160 KiB
17Time limit exceeded0/2284ms1076 KiB
18Time limit exceeded0/2282ms1076 KiB
19Time limit exceeded0/2282ms1036 KiB
20Wrong answer0/220ms608 KiB
21Time limit exceeded0/2300ms1076 KiB
22Time limit exceeded0/2300ms1000 KiB