108572024-04-17 07:54:33VargusFasor (40)cpp17Wrong answer 0/4082ms17584 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    ll n, k;
    cin >> n >> k;
    vector <ll> x(n + 1);
    for (ll i = 1; i <= n; ++i)
    {
        cin >> x[i];
    }
    bool ok;
    ll poz = 0, i2 = 0;
    for (ll i = 1; i <= n - k; ++i)
    {
        ok = false;
        i2 = i;
        for (ll j = i2 + 1; j <= k + i2; ++j)
        {
            if (x[i] < x[j])
            {
                ok = true;
                poz = j;
                i = j - 1;
            }
        }
        if (!ok)
        {
            cout << poz;
            return 0;
        }
    }

    return 0;
}
/*
10 3
6 2 1 8 4 8 7 12 9 3
*/
SubtaskSumTestVerdictTimeMemory
base0/40
1Accepted0/03ms1808 KiB
2Wrong answer0/06ms2260 KiB
3Wrong answer0/23ms2320 KiB
4Wrong answer0/23ms2380 KiB
5Wrong answer0/23ms2588 KiB
6Wrong answer0/23ms2676 KiB
7Wrong answer0/23ms2812 KiB
8Wrong answer0/24ms2932 KiB
9Wrong answer0/26ms3212 KiB
10Wrong answer0/27ms3532 KiB
11Wrong answer0/27ms3376 KiB
12Wrong answer0/24ms3400 KiB
13Wrong answer0/241ms5352 KiB
14Wrong answer0/237ms6164 KiB
15Wrong answer0/264ms8640 KiB
16Wrong answer0/272ms9996 KiB
17Wrong answer0/281ms11496 KiB
18Wrong answer0/282ms12956 KiB
19Wrong answer0/281ms14432 KiB
20Wrong answer0/225ms13420 KiB
21Wrong answer0/264ms16216 KiB
22Wrong answer0/281ms17584 KiB