25662023-01-17 12:54:38Tibi23Fasor (40)cpp11Time limit exceeded 20/40300ms4016 KiB
#include <iostream>

using namespace std;



int main()
{
    int n,d;

    cin>>n;
    cin>>d;
    int lista[n];
    for(int i=0; i<n; i++){
        cin>>lista[i];
    }

    bool rossz_hely =false;
    for(int i=0; i<n;i++){
        rossz_hely=false;
        for(int j=i-d; j<=i+d; j++){

            if(j>0 && j<n){
                if(lista[j]>lista[i]){
                    rossz_hely=true;
                     break;
                }

            }
        }
        if(!rossz_hely){
            cout<<i+1;
            return 0;
        }

    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/03ms1748 KiB
2Accepted0/04ms2092 KiB
3Accepted2/22ms2160 KiB
4Accepted2/22ms2320 KiB
5Accepted2/22ms2568 KiB
6Accepted2/22ms2512 KiB
7Accepted2/22ms2648 KiB
8Accepted2/23ms2884 KiB
9Accepted2/24ms3160 KiB
10Accepted2/26ms3240 KiB
11Accepted2/26ms3196 KiB
12Accepted2/24ms3200 KiB
13Time limit exceeded0/2300ms2900 KiB
14Time limit exceeded0/2268ms2940 KiB
15Time limit exceeded0/2270ms3508 KiB
16Time limit exceeded0/2241ms3552 KiB
17Time limit exceeded0/2268ms3648 KiB
18Time limit exceeded0/2261ms3840 KiB
19Time limit exceeded0/2273ms3908 KiB
20Time limit exceeded0/2270ms3516 KiB
21Time limit exceeded0/2229ms3992 KiB
22Time limit exceeded0/2246ms4016 KiB