68452023-12-19 10:57:55madvirFasor (40)cpp17Wrong answer 10/40270ms5280 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int x=k+1, a[n+1];

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

    bool kis, end1=false;
    while(x<n-k && !end1) {
        kis=true;
        for(int i=x-k; i<=x+k && kis; i++) {
            if(a[i]>a[x]) kis=false;
        }
        if(kis) end1=true;
        x++;
    }
    cout << --x;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base10/40
1Accepted0/03ms1876 KiB
2Accepted0/04ms2100 KiB
3Wrong answer0/23ms2284 KiB
4Wrong answer0/23ms2500 KiB
5Wrong answer0/23ms2700 KiB
6Accepted2/23ms2968 KiB
7Wrong answer0/23ms2980 KiB
8Accepted2/23ms3120 KiB
9Wrong answer0/24ms3220 KiB
10Accepted2/26ms3104 KiB
11Accepted2/26ms3100 KiB
12Wrong answer0/24ms3104 KiB
13Time limit exceeded0/2252ms2688 KiB
14Wrong answer0/235ms3840 KiB
15Time limit exceeded0/2254ms3104 KiB
16Time limit exceeded0/2266ms3100 KiB
17Time limit exceeded0/2238ms3224 KiB
18Time limit exceeded0/2270ms3400 KiB
19Time limit exceeded0/2257ms3324 KiB
20Accepted2/223ms4260 KiB
21Time limit exceeded0/2254ms3536 KiB
22Wrong answer0/274ms5280 KiB