219052026-01-14 10:12:42BDavid5616Fasor (40)cpp17Wrong answer 12/40300ms1128 KiB
#include <iostream>
using namespace std;

int main()
{int i,q,db,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/01ms316 KiB
2Accepted0/04ms500 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Accepted2/21ms332 KiB
9Wrong answer0/24ms316 KiB
10Accepted2/24ms316 KiB
11Accepted2/24ms316 KiB
12Wrong answer0/23ms316 KiB
13Time limit exceeded0/2300ms560 KiB
14Time limit exceeded0/2298ms600 KiB
15Time limit exceeded0/2298ms1056 KiB
16Time limit exceeded0/2298ms1024 KiB
17Time limit exceeded0/2282ms1076 KiB
18Time limit exceeded0/2286ms1128 KiB
19Time limit exceeded0/2286ms1112 KiB
20Time limit exceeded0/2287ms760 KiB
21Time limit exceeded0/2284ms944 KiB
22Wrong answer0/270ms1100 KiB