219682026-01-14 11:47:49BDavid5616Fasor (40)cpp17Wrong answer 12/40300ms1076 KiB
#include <iostream>
using namespace std;

int main()
{int i,s,t,b,a[200000],n,k;
    cin>>n>>k;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    b=-1;i=0;
    while(i<n && b==-1){t=1;s=1;
        while(s<=k && t==1){
            if(a[i]<a[i+s] || a[i]<a[i-s])t=0;
            s++;
        }
        if(t==1)b=i+1;
        i++;
    }cout<<b;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/40
1Accepted0/01ms500 KiB
2Accepted0/04ms316 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Accepted2/22ms316 KiB
9Wrong answer0/24ms316 KiB
10Accepted2/24ms316 KiB
11Accepted2/24ms316 KiB
12Wrong answer0/23ms316 KiB
13Time limit exceeded0/2300ms632 KiB
14Time limit exceeded0/2300ms740 KiB
15Time limit exceeded0/2300ms1076 KiB
16Time limit exceeded0/2300ms1008 KiB
17Time limit exceeded0/2282ms1076 KiB
18Time limit exceeded0/2282ms1076 KiB
19Time limit exceeded0/2284ms1076 KiB
20Time limit exceeded0/2284ms760 KiB
21Time limit exceeded0/2287ms924 KiB
22Wrong answer0/271ms1036 KiB