127912024-12-31 12:05:51MrkzFasor (40)cpp17Wrong answer 4/402ms572 KiB
#include <iostream>
#include <fstream>
using namespace std;
int n,k,h[1000000];
int bagoly(int i){
    bool b=true;
    for(int j=1;j<=k;j++){
        if(h[i+j]>h[i])
            b=false;
        if(h[i-j]>h[i])
            b=false;
    }
    if(b==true)
        return i;
    else
        return bagoly(i+1);
}
int main()
{
    ifstream f("fasor.in");
    f>>n>>k;
    for(int i=1;i<=n;i++)
    {
        f>>h[i];
    }
    cout<<bagoly(1);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Wrong answer0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Wrong answer0/21ms508 KiB
4Wrong answer0/21ms320 KiB
5Accepted2/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/21ms320 KiB
9Accepted2/21ms320 KiB
10Wrong answer0/21ms320 KiB
11Wrong answer0/21ms320 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/21ms336 KiB
14Wrong answer0/21ms320 KiB
15Wrong answer0/21ms320 KiB
16Wrong answer0/21ms320 KiB
17Wrong answer0/22ms320 KiB
18Wrong answer0/22ms572 KiB
19Wrong answer0/22ms320 KiB
20Wrong answer0/22ms500 KiB
21Wrong answer0/21ms320 KiB
22Wrong answer0/21ms320 KiB