178012025-09-17 18:26:16algoproFasor (40)cpp17Time limit exceeded 22/40300ms2552 KiB
// UUID: bd63fd49-aae7-4fea-8963-179875205254
#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	int K;
	cin >> N >> K;
	vector<int> v;

	for (int i = 0; i < N; i++){
		int H;
		cin >> H;
		v.push_back(H);
	}
	for (int i = 0; i < K; i++){
		v.push_back(0);
	}
	
	int elso = 0;

	for (int i = 0; i < N; i++){
		bool a = true;
		for (int j = 1; j < K+1; j++){
			if (v[i] < v [i+j]){
				a = false;
				break;
			}	
		}
		if (a == true){
			elso = i+1;
			break;
		}
	}
	cout << elso;

}
SubtaskSumTestVerdictTimeMemory
base22/40
1Accepted0/01ms508 KiB
2Accepted0/04ms316 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms508 KiB
5Accepted2/21ms332 KiB
6Accepted2/21ms316 KiB
7Accepted2/21ms316 KiB
8Accepted2/22ms316 KiB
9Accepted2/24ms328 KiB
10Accepted2/24ms316 KiB
11Accepted2/24ms316 KiB
12Accepted2/23ms316 KiB
13Time limit exceeded0/2298ms1020 KiB
14Time limit exceeded0/2300ms2356 KiB
15Time limit exceeded0/2300ms2552 KiB
16Time limit exceeded0/2298ms1428 KiB
17Time limit exceeded0/2284ms2476 KiB
18Time limit exceeded0/2273ms1456 KiB
19Time limit exceeded0/2219ms1388 KiB
20Time limit exceeded0/2287ms1364 KiB
21Time limit exceeded0/2287ms2472 KiB
22Accepted2/275ms1452 KiB