223852026-01-14 22:51:43FintaTihamerFasor (40)cpp17Wrong answer 0/4075ms1176 KiB
#include <iostream>
#include <fstream>
using namespace std;
bool z=false;
void ki(int y, bool z1){
    if(z1) cout<<y+1;
    else cout<<-1;
}
int moz(){
    int n;
    int k;
    int a[200000];
    int j=0;
    int i=1;
    cin>>n>>k;
    int k1=k;
    for(int x=0; x<n; x++) cin>>a[x];
    while(i<n && k1>=0){
        if(a[i]>a[j] && k1>=0 && i>j) {j=i; k1=k; z=true;}
        k1--;
        i++;
    }
    return j;
}
int main()
{   ki(moz(),z);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/01ms316 KiB
2Wrong answer0/04ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms508 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms544 KiB
8Wrong answer0/22ms508 KiB
9Wrong answer0/24ms552 KiB
10Wrong answer0/24ms316 KiB
11Wrong answer0/24ms560 KiB
12Wrong answer0/23ms560 KiB
13Wrong answer0/237ms720 KiB
14Wrong answer0/235ms720 KiB
15Wrong answer0/259ms1032 KiB
16Wrong answer0/268ms1176 KiB
17Wrong answer0/275ms1076 KiB
18Wrong answer0/275ms1032 KiB
19Wrong answer0/274ms984 KiB
20Wrong answer0/221ms724 KiB
21Wrong answer0/261ms1076 KiB
22Wrong answer0/274ms1076 KiB