25722023-01-17 15:20:56LeviRFasor (40)cpp11Time limit exceeded 20/40300ms4260 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/03ms1880 KiB
2Accepted0/04ms2100 KiB
3Accepted2/22ms2272 KiB
4Accepted2/22ms2476 KiB
5Accepted2/22ms2680 KiB
6Accepted2/22ms2924 KiB
7Accepted2/22ms3132 KiB
8Accepted2/23ms3224 KiB
9Accepted2/24ms3200 KiB
10Accepted2/26ms3324 KiB
11Accepted2/26ms3540 KiB
12Accepted2/24ms3744 KiB
13Time limit exceeded0/2300ms3368 KiB
14Time limit exceeded0/2245ms3308 KiB
15Time limit exceeded0/2273ms3888 KiB
16Time limit exceeded0/2268ms4112 KiB
17Time limit exceeded0/2277ms4020 KiB
18Time limit exceeded0/2273ms4152 KiB
19Time limit exceeded0/2268ms4032 KiB
20Time limit exceeded0/2257ms3764 KiB
21Time limit exceeded0/2250ms4160 KiB
22Time limit exceeded0/2248ms4260 KiB