114472024-09-26 07:59:44tKriszFasor (40)cpp14Accepted 40/4046ms504 KiB
#include <iostream>

using namespace std;

int main()
{
    int cmax=0, maxi=1;
    int n, k, temp1, c, counter=0;
    cin>>n>>k>>cmax;
    for(int i=2;i<=n;i++){
        cin>>c;
        counter++;
        if(cmax<c){
            cmax=c;
            maxi=i;
            counter=0;
        }
        if(counter>=k){
            break;
        }
    }
    cout<<maxi;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms360 KiB
2Accepted0/03ms360 KiB
3Accepted2/23ms500 KiB
4Accepted2/23ms488 KiB
5Accepted2/23ms400 KiB
6Accepted2/22ms232 KiB
7Accepted2/23ms504 KiB
8Accepted2/22ms372 KiB
9Accepted2/22ms360 KiB
10Accepted2/23ms360 KiB
11Accepted2/23ms360 KiB
12Accepted2/23ms256 KiB
13Accepted2/237ms400 KiB
14Accepted2/235ms372 KiB
15Accepted2/241ms416 KiB
16Accepted2/235ms256 KiB
17Accepted2/246ms280 KiB
18Accepted2/235ms360 KiB
19Accepted2/237ms360 KiB
20Accepted2/223ms372 KiB
21Accepted2/246ms384 KiB
22Accepted2/234ms360 KiB