25712023-01-17 15:20:46KrisztianFasor (40)cpp11Time limit exceeded 20/40277ms4812 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/03ms1748 KiB
2Accepted0/04ms1952 KiB
3Accepted2/22ms2112 KiB
4Accepted2/22ms2320 KiB
5Accepted2/22ms2524 KiB
6Accepted2/22ms2724 KiB
7Accepted2/22ms2972 KiB
8Accepted2/23ms3180 KiB
9Accepted2/24ms3244 KiB
10Accepted2/26ms3388 KiB
11Accepted2/26ms3472 KiB
12Accepted2/24ms3464 KiB
13Time limit exceeded0/2270ms3156 KiB
14Time limit exceeded0/2229ms3404 KiB
15Time limit exceeded0/2229ms3840 KiB
16Time limit exceeded0/2261ms3928 KiB
17Time limit exceeded0/2277ms4236 KiB
18Time limit exceeded0/2264ms4332 KiB
19Time limit exceeded0/2268ms4404 KiB
20Time limit exceeded0/2256ms4156 KiB
21Time limit exceeded0/2266ms4772 KiB
22Time limit exceeded0/2268ms4812 KiB