134472025-01-08 07:40:44GundischBalazsFasor (40)cpp17Wrong answer 0/402ms548 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, k,maxi,db=0,x,i=1,mi;
    cin >> n >> k;
    cin >> x;
    maxi = x;
   while(i >= n){
        cin >> x;
        if(x > maxi){
            maxi = x;
            mi = i;
            db=0;
        }
        else{
            db++;
        }
        if(db==k){
            cout << mi+1;
            return 0;
        }
        i++;
    }
    cout << -1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms548 KiB
6Wrong answer0/22ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms508 KiB
9Wrong answer0/21ms316 KiB
10Wrong answer0/21ms332 KiB
11Wrong answer0/21ms316 KiB
12Wrong answer0/21ms500 KiB
13Wrong answer0/21ms316 KiB
14Wrong answer0/21ms500 KiB
15Wrong answer0/21ms316 KiB
16Wrong answer0/21ms316 KiB
17Wrong answer0/21ms316 KiB
18Wrong answer0/21ms316 KiB
19Wrong answer0/21ms508 KiB
20Wrong answer0/21ms316 KiB
21Wrong answer0/21ms316 KiB
22Wrong answer0/21ms508 KiB