219852026-01-14 12:18:17szentedFasor (40)cpp17Wrong answer 10/40300ms1112 KiB
#include <iostream>
//#include <fstream>

using namespace std;

int vizsgal(int a[200000], int n, int k){
    for(int i=k; i<n-k; i++){
        int x=1;
        while(x<=k && a[i]>=a[i-x] && a[i]>=a[i+x]) x++;
        if(x>k) return i+1;
    }
}

int main()
{
    //ifstream f("be.in");
    int n;
    int k;
    //f >> n;
    //f >> k;
    cin >> n;
    cin >> k;
    int b[200000];

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

    cout << vizsgal(b,n,k);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base10/40
1Accepted0/01ms316 KiB
2Accepted0/04ms316 KiB
3Wrong answer0/21ms500 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms500 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Accepted2/22ms316 KiB
9Wrong answer0/24ms316 KiB
10Accepted2/24ms332 KiB
11Accepted2/24ms508 KiB
12Wrong answer0/23ms316 KiB
13Time limit exceeded0/2300ms736 KiB
14Runtime error0/232ms728 KiB
15Time limit exceeded0/2300ms944 KiB
16Time limit exceeded0/2300ms1112 KiB
17Time limit exceeded0/2284ms1076 KiB
18Time limit exceeded0/2247ms1072 KiB
19Time limit exceeded0/2289ms1084 KiB
20Wrong answer0/219ms972 KiB
21Time limit exceeded0/2284ms1000 KiB
22Wrong answer0/270ms1076 KiB