218782026-01-14 09:45:12BDavid5616Fasor (40)cpp17Wrong answer 12/40300ms1120 KiB
#include <iostream>

using namespace std;

int main()
{int i,q,db,s,t,b,c=1,a[200000],n,k;
    cin>>n>>k;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    b=-1;i=0;
    while(i<n && c==1){q=i+k;t=1;
        if(i<k){s=i+1;
            while(s<=q && t==1){
                if(a[i]<a[s])t=0;
                s++;
        }
        }
        if(i>=k){
        while(s<=q && t==1){
            if(a[i]<a[s] && a[i]<a[s-i])t=0;
            s++;
        }
        }
        if(t==1 && c==1){b=i+1;c=0;}
        i++;
    }cout<<b;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/40
1Accepted0/01ms500 KiB
2Wrong answer0/04ms316 KiB
3Accepted2/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/22ms316 KiB
9Accepted2/24ms316 KiB
10Wrong answer0/24ms428 KiB
11Wrong answer0/24ms316 KiB
12Accepted2/23ms316 KiB
13Time limit exceeded0/2284ms564 KiB
14Time limit exceeded0/2284ms560 KiB
15Time limit exceeded0/2284ms1076 KiB
16Time limit exceeded0/2300ms1076 KiB
17Time limit exceeded0/2282ms1080 KiB
18Time limit exceeded0/2284ms1008 KiB
19Wrong answer0/2101ms1076 KiB
20Time limit exceeded0/2300ms652 KiB
21Time limit exceeded0/2277ms1120 KiB
22Accepted2/275ms944 KiB