114442024-09-26 07:32:20tKriszFasor (40)cpp14Wrong answer 34/4071ms1272 KiB
#include <iostream>


using namespace std;


int main()
{
    int v[200002]={0};
    int cmax=0;
    int n,k, temp1;
    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];
        }
        if((i-k)>0) if(v[i-k]==cmax){
            cout<<i-k;
            break;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/03ms1128 KiB
2Accepted0/06ms1128 KiB
3Accepted2/23ms1128 KiB
4Wrong answer0/23ms1108 KiB
5Accepted2/23ms1272 KiB
6Accepted2/23ms1128 KiB
7Accepted2/23ms1272 KiB
8Accepted2/23ms1128 KiB
9Accepted2/26ms1128 KiB
10Accepted2/27ms1000 KiB
11Accepted2/27ms1144 KiB
12Accepted2/24ms1128 KiB
13Accepted2/237ms1168 KiB
14Wrong answer0/234ms1140 KiB
15Accepted2/256ms1128 KiB
16Accepted2/264ms1140 KiB
17Accepted2/271ms1144 KiB
18Accepted2/271ms1144 KiB
19Accepted2/271ms1144 KiB
20Wrong answer0/221ms1128 KiB
21Accepted2/257ms1144 KiB
22Accepted2/271ms1144 KiB