114462024-09-26 07:50:09tKriszFasor (40)cpp14Wrong answer 34/4043ms528 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){
            cout<<maxi;
            break;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/03ms400 KiB
2Accepted0/03ms360 KiB
3Accepted2/23ms360 KiB
4Wrong answer0/23ms384 KiB
5Accepted2/23ms232 KiB
6Accepted2/22ms504 KiB
7Accepted2/22ms360 KiB
8Accepted2/22ms360 KiB
9Accepted2/23ms400 KiB
10Accepted2/23ms360 KiB
11Accepted2/23ms504 KiB
12Accepted2/23ms256 KiB
13Accepted2/235ms384 KiB
14Wrong answer0/234ms232 KiB
15Accepted2/237ms384 KiB
16Accepted2/232ms360 KiB
17Accepted2/243ms528 KiB
18Accepted2/234ms392 KiB
19Accepted2/234ms384 KiB
20Wrong answer0/221ms500 KiB
21Accepted2/243ms268 KiB
22Accepted2/232ms376 KiB