90962024-02-13 21:32:20RRoliFasor (40)cpp17Accepted 40/4045ms4100 KiB
#include <bits/stdc++.h>
using namespace std;

int n, k, most;

int main() {
	cin >> n >> k >> most;
	int max_i = 1, max_sz = most;
	for(int i = 2; i <= n; i++) {
		cin >> most;
		if(i - max_i > k) break;
		if(most > max_sz) {
			max_sz = most;
			max_i = i;
 		}
	}
	cout << max_i;
 
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1872 KiB
2Accepted0/03ms2120 KiB
3Accepted2/22ms2204 KiB
4Accepted2/23ms2336 KiB
5Accepted2/23ms2552 KiB
6Accepted2/23ms2640 KiB
7Accepted2/23ms2828 KiB
8Accepted2/23ms2988 KiB
9Accepted2/23ms3068 KiB
10Accepted2/23ms3192 KiB
11Accepted2/23ms3416 KiB
12Accepted2/23ms3388 KiB
13Accepted2/237ms3516 KiB
14Accepted2/234ms3632 KiB
15Accepted2/239ms3756 KiB
16Accepted2/234ms3724 KiB
17Accepted2/243ms3868 KiB
18Accepted2/234ms3800 KiB
19Accepted2/235ms4044 KiB
20Accepted2/223ms4092 KiB
21Accepted2/245ms4092 KiB
22Accepted2/232ms4100 KiB