108922024-04-18 09:26:39VargusFasor (40)cpp17Wrong answer 34/4076ms6372 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];
    }
    ll j = 1, poz = -1;
    for (ll i = j + 1; i <= k + j; ++i)
    {
        if (x[j] < x[i])
        {
            poz = i;
            j = i;
        }
    }
    cout << poz;

    return 0;
}
/*
10 3
6 2 1 8 4 8 7 12 9 3
*/
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/03ms1812 KiB
2Accepted0/04ms2136 KiB
3Accepted2/23ms2228 KiB
4Accepted2/23ms2260 KiB
5Wrong answer0/23ms2496 KiB
6Accepted2/23ms2736 KiB
7Accepted2/23ms2640 KiB
8Accepted2/23ms2836 KiB
9Wrong answer0/24ms3256 KiB
10Accepted2/26ms3184 KiB
11Accepted2/26ms3188 KiB
12Accepted2/24ms3152 KiB
13Accepted2/239ms4432 KiB
14Runtime error0/234ms4808 KiB
15Accepted2/257ms5988 KiB
16Accepted2/270ms5992 KiB
17Accepted2/276ms5988 KiB
18Accepted2/271ms5988 KiB
19Accepted2/271ms6248 KiB
20Accepted2/224ms4768 KiB
21Accepted2/259ms6372 KiB
22Accepted2/271ms6372 KiB