114452024-09-26 07:34:35tKriszFasor (40)cpp14Wrong answer 34/4074ms1296 KiB
#include <iostream>

using namespace std;

int main()
{
    int v[200002]={0};
    int cmax=0, maxi=0;
    int n,k, temp1;
    bool a=0;
    cin>>n>>k;
    v[0]=-1;
    v[n+1]=-1;
    for(int i=1;i<=n;i++){
        cin>>v[i];
    }
    for(int i=1;i<=n;i++){
        if(cmax<v[i]){
            cmax=v[i];
            maxi=i;
            a=1;
        }
        if((i-k)>0) if(v[i-k]==cmax){
            cout<<maxi;
            break;
        }
    }
    if(a==0){
        cout<<maxi;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/03ms1128 KiB
2Accepted0/06ms1128 KiB
3Accepted2/23ms1168 KiB
4Wrong answer0/23ms1136 KiB
5Accepted2/23ms1296 KiB
6Accepted2/23ms1144 KiB
7Accepted2/23ms1128 KiB
8Accepted2/24ms1144 KiB
9Accepted2/26ms1148 KiB
10Accepted2/27ms1144 KiB
11Accepted2/27ms1128 KiB
12Accepted2/24ms1272 KiB
13Accepted2/239ms1180 KiB
14Wrong answer0/235ms1144 KiB
15Accepted2/259ms1268 KiB
16Accepted2/267ms1144 KiB
17Accepted2/274ms1144 KiB
18Accepted2/274ms1052 KiB
19Accepted2/272ms1272 KiB
20Wrong answer0/223ms1000 KiB
21Accepted2/259ms1128 KiB
22Accepted2/274ms1164 KiB