220052026-01-14 12:34:22sandormeszicsFasor (40)cpp17Wrong answer 8/40300ms1140 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/01ms316 KiB
2Accepted0/04ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms500 KiB
5Wrong answer0/21ms316 KiB
6Accepted2/21ms508 KiB
7Wrong answer0/21ms316 KiB
8Accepted2/22ms316 KiB
9Wrong answer0/24ms324 KiB
10Accepted2/24ms316 KiB
11Accepted2/24ms316 KiB
12Wrong answer0/23ms316 KiB
13Time limit exceeded0/2300ms752 KiB
14Wrong answer0/232ms736 KiB
15Time limit exceeded0/2298ms1084 KiB
16Time limit exceeded0/2300ms1128 KiB
17Time limit exceeded0/2289ms1076 KiB
18Time limit exceeded0/2287ms1076 KiB
19Time limit exceeded0/2287ms1140 KiB
20Wrong answer0/220ms564 KiB
21Time limit exceeded0/2277ms1076 KiB
22Time limit exceeded0/2277ms1076 KiB