25742023-01-17 15:21:35KrisztianFasor (40)cpp11Time limit exceeded 20/40273ms4208 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/22ms2268 KiB
4Accepted2/22ms2380 KiB
5Accepted2/22ms2556 KiB
6Accepted2/22ms2616 KiB
7Accepted2/22ms2780 KiB
8Accepted2/23ms2904 KiB
9Accepted2/24ms3060 KiB
10Accepted2/26ms3264 KiB
11Accepted2/26ms3612 KiB
12Accepted2/24ms3664 KiB
13Time limit exceeded0/2256ms3196 KiB
14Time limit exceeded0/2252ms3428 KiB
15Time limit exceeded0/2264ms4028 KiB
16Time limit exceeded0/2240ms4140 KiB
17Time limit exceeded0/2246ms4068 KiB
18Time limit exceeded0/2273ms3896 KiB
19Time limit exceeded0/2273ms3928 KiB
20Time limit exceeded0/2256ms3744 KiB
21Time limit exceeded0/2254ms4208 KiB
22Time limit exceeded0/2261ms4196 KiB