37972023-03-02 22:37:36Erik_GepardFasor (40)cpp17Wrong answer 24/4025ms6064 KiB
#include<bits/stdc++.h>
using namespace std;

void solve(){
    int n, k;
    cin>>n>>k;
    vector<int> a(n);
    for(int &x : a) cin>>x;
    int maxi=a[0], maxih=0, db=k;
    for(int i=1; i<n; i++){
        k--;
        if(a[i]>maxi){
            db=k;
            maxih=i;
            maxi=a[i];
        }
        if(k<0) break;
    }
    cout<<maxih+1<<"\n";
    return;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base24/40
1Accepted0/03ms1824 KiB
2Wrong answer0/04ms2228 KiB
3Accepted2/23ms2372 KiB
4Wrong answer0/22ms2348 KiB
5Accepted2/23ms2476 KiB
6Wrong answer0/23ms2664 KiB
7Accepted2/23ms2888 KiB
8Wrong answer0/23ms3108 KiB
9Accepted2/23ms3496 KiB
10Wrong answer0/24ms3696 KiB
11Wrong answer0/24ms3652 KiB
12Accepted2/23ms3776 KiB
13Wrong answer0/214ms4740 KiB
14Accepted2/213ms4956 KiB
15Accepted2/221ms5556 KiB
16Accepted2/223ms5432 KiB
17Accepted2/225ms5500 KiB
18Wrong answer0/224ms5688 KiB
19Wrong answer0/224ms5756 KiB
20Accepted2/29ms5320 KiB
21Accepted2/220ms6052 KiB
22Accepted2/224ms6064 KiB