218792026-01-14 09:47:08BDavid5616Fasor (40)cpp17Wrong answer 12/40300ms1268 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/01ms508 KiB
2Wrong answer0/04ms500 KiB
3Accepted2/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/21ms508 KiB
7Accepted2/21ms388 KiB
8Wrong answer0/21ms316 KiB
9Accepted2/24ms444 KiB
10Wrong answer0/24ms316 KiB
11Wrong answer0/24ms404 KiB
12Accepted2/23ms316 KiB
13Time limit exceeded0/2300ms760 KiB
14Time limit exceeded0/2300ms748 KiB
15Time limit exceeded0/2300ms1080 KiB
16Time limit exceeded0/2300ms980 KiB
17Time limit exceeded0/2275ms1088 KiB
18Time limit exceeded0/2275ms1268 KiB
19Wrong answer0/294ms1076 KiB
20Time limit exceeded0/2277ms792 KiB
21Time limit exceeded0/2280ms1076 KiB
22Accepted2/271ms1200 KiB