235192026-01-24 10:30:26BalázsFasor (40)cpp17Wrong answer 2/4072ms1976 KiB
#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int main()
{
    int jelenlegi=0;
    int kovetkezo=1;
    int n,k;
    cin>>n>>k;
    vector<long long>fasor(n);
        for (int i=0; i<n; i++){
            cin>>fasor[i];
        }
    for(int i=1; i<=n; i++){
        if(fasor[i]>fasor[jelenlegi]){
            if(i-jelenlegi+1>k){
                cout<<i+1;
                return 0;
            }
            else{
                jelenlegi=kovetkezo;
            }
        }
    else{
        kovetkezo++;
    }
    }
    cout<<"-1";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/01ms316 KiB
2Wrong answer0/04ms508 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/22ms508 KiB
9Wrong answer0/24ms368 KiB
10Wrong answer0/24ms396 KiB
11Wrong answer0/24ms316 KiB
12Wrong answer0/23ms316 KiB
13Wrong answer0/237ms1192 KiB
14Wrong answer0/234ms1076 KiB
15Wrong answer0/257ms1844 KiB
16Wrong answer0/265ms1976 KiB
17Wrong answer0/272ms1844 KiB
18Wrong answer0/272ms1844 KiB
19Wrong answer0/271ms1844 KiB
20Wrong answer0/221ms1192 KiB
21Wrong answer0/259ms1884 KiB
22Wrong answer0/271ms1848 KiB