53862023-04-30 10:13:27Laci3000Fasor (40)cpp17Accepted 40/4026ms16024 KiB
// nt2020 masodik.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <vector>
#include <iostream>

using namespace std;



void fak_es_a_bagoly() {
	int trees, distance;
	cin >> trees >> distance;
	vector<int> listS(trees);
	for (size_t i = 0; i < trees; i++)
	{
		cin >> listS[i];
	}
	int helyzetem = 0, i;
    for (size_t i = 0; i < helyzetem + distance + 1 && i < trees; i++)
	{
		if (listS[i] > listS[helyzetem]) {
			helyzetem = i;
		}
	}
	cout << ++helyzetem << '\n';
}

int main()
{
	cin.sync_with_stdio(false);
	cin.tie(nullptr);
	fak_es_a_bagoly();
}

SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1956 KiB
2Accepted0/04ms2256 KiB
3Accepted2/23ms2216 KiB
4Accepted2/23ms2280 KiB
5Accepted2/23ms2388 KiB
6Accepted2/23ms2612 KiB
7Accepted2/23ms2892 KiB
8Accepted2/23ms2996 KiB
9Accepted2/23ms3152 KiB
10Accepted2/24ms3340 KiB
11Accepted2/24ms3472 KiB
12Accepted2/23ms3760 KiB
13Accepted2/214ms5284 KiB
14Accepted2/213ms5872 KiB
15Accepted2/221ms7488 KiB
16Accepted2/224ms8640 KiB
17Accepted2/225ms10200 KiB
18Accepted2/225ms11720 KiB
19Accepted2/226ms13308 KiB
20Accepted2/210ms12964 KiB
21Accepted2/221ms14696 KiB
22Accepted2/226ms16024 KiB