25732023-01-17 15:21:17pyramisFasor (40)cpp11Time limit exceeded 20/40300ms4384 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    int d;

    cin>>n;
    cin>>d;

    int fasor[n];

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

    bool rossz_hely;
    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(fasor[j]> fasor[i]){
                rossz_hely=true;
                break;
            }
        }
    }
        if(rossz_hely==false){
            cout<<i+1;
            return 0;

        }
    }






    return 0;
}
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/03ms1876 KiB
2Accepted0/04ms2160 KiB
3Accepted2/22ms2320 KiB
4Accepted2/22ms2524 KiB
5Accepted2/22ms2596 KiB
6Accepted2/22ms2556 KiB
7Accepted2/22ms2576 KiB
8Accepted2/23ms2788 KiB
9Accepted2/24ms3048 KiB
10Accepted2/26ms3260 KiB
11Accepted2/26ms3424 KiB
12Accepted2/24ms3632 KiB
13Time limit exceeded0/2300ms3268 KiB
14Time limit exceeded0/2264ms3444 KiB
15Time limit exceeded0/2270ms3896 KiB
16Time limit exceeded0/2261ms3656 KiB
17Time limit exceeded0/2280ms3784 KiB
18Time limit exceeded0/2277ms3992 KiB
19Time limit exceeded0/2257ms4172 KiB
20Time limit exceeded0/2268ms3968 KiB
21Time limit exceeded0/2252ms4372 KiB
22Time limit exceeded0/2256ms4384 KiB