218802026-01-14 09:50:13BDavid5616Fasor (40)cpp17Wrong answer 12/40300ms1160 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){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){s=i+1;
        while(s<=q && t==1){
            if(a[i]<a[s] && a[i]<a[s-i])t=0;
            s++;
        }
        }
        if(t==1)b=i+1;
        i++;
    }cout<<b;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/40
1Accepted0/01ms316 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/24ms316 KiB
11Wrong answer0/24ms316 KiB
12Accepted2/23ms316 KiB
13Time limit exceeded0/2300ms764 KiB
14Time limit exceeded0/2300ms564 KiB
15Time limit exceeded0/2298ms1160 KiB
16Time limit exceeded0/2300ms972 KiB
17Time limit exceeded0/2282ms1048 KiB
18Time limit exceeded0/2282ms1084 KiB
19Wrong answer0/296ms1044 KiB
20Time limit exceeded0/2284ms564 KiB
21Time limit exceeded0/2277ms1076 KiB
22Accepted2/271ms1044 KiB