27912023-01-25 09:20:10tamasmarkFasor (40)cpp17Wrong answer 10/4076ms7024 KiB
//nemes fasor.cpp : This file contains the 'main' function.Program execution begins and ends there.
//

#include <iostream>
#include <vector>

using namespace std;

vector<long long >x;
long long i, n, k, j;
bool t;

int main()
{
    cin >> n >> k;
    x.resize(n + 1);
    for (i = 1; i <= n; ++i)
    {
        cin >> x[i];
    }
    i = 1;
    while (i < x.size() - 1)
    {
        t = false;
        if (x[i] > x[i + 1])
        {
            for (j = i + 1; j <= k + i; ++j)
            {
                if (x[i] < x[j])
                {
                    i = j;
                    t = true;
                    break;
                }
            }
        }
        else if (x[i] < x[i + 1]) ++i;
        if (!t) break;
    }
    cout << i;
    return 0;
}
/*
10 3
6 2 1 8 4 8 7 12 9 3
*/
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base10/40
1Accepted0/03ms1876 KiB
2Accepted0/04ms2272 KiB
3Wrong answer0/22ms2276 KiB
4Wrong answer0/22ms2516 KiB
5Accepted2/22ms2588 KiB
6Wrong answer0/22ms2792 KiB
7Accepted2/22ms2816 KiB
8Wrong answer0/23ms3020 KiB
9Accepted2/24ms3304 KiB
10Wrong answer0/26ms3508 KiB
11Wrong answer0/26ms3548 KiB
12Accepted2/24ms3800 KiB
13Wrong answer0/237ms5024 KiB
14Wrong answer0/235ms4936 KiB
15Wrong answer0/257ms6624 KiB
16Wrong answer0/268ms6828 KiB
17Wrong answer0/274ms6900 KiB
18Wrong answer0/276ms6904 KiB
19Wrong answer0/272ms6904 KiB
20Wrong answer0/223ms5620 KiB
21Wrong answer0/261ms7024 KiB
22Accepted2/272ms7020 KiB