7422022-01-03 17:21:07kismartongFasor (40)python3Runtime error 18/40296ms50204 KiB
from sys import stdin, stdout

def gen(tomb, i, k, n):
	arr = []
	if i < k:
		arr = tomb[:i]
	else:
		for b in range(i-k-1, i):
			arr.append(tomb[b])
	if i+k > n:
		arr.extend(tomb[i:])
	else:
		for j in range(i, i+k+1):
			arr.append(tomb[j])
	return arr

def main():
	n, k = map(int, stdin.readline().split())
	tomb = list(map(int, stdin.readline().split()))
	for i in range(n):
		if tomb[i] == max(gen(tomb, i, k, n)):
			stdout.writelines(str(i+1) + "\n")
			break

main()
SubtaskSumTestVerdictTimeMemory
base18/40
1Accepted0/037ms13044 KiB
2Accepted0/034ms15392 KiB
3Accepted2/232ms13112 KiB
4Runtime error0/229ms13072 KiB
5Accepted2/229ms13144 KiB
6Accepted2/228ms13124 KiB
7Accepted2/228ms13124 KiB
8Accepted2/241ms13472 KiB
9Accepted2/239ms15176 KiB
10Accepted2/235ms15568 KiB
11Accepted2/241ms15332 KiB
12Accepted2/239ms14748 KiB
13Time limit exceeded0/2296ms16240 KiB
14Time limit exceeded0/2243ms16936 KiB
15Runtime error0/281ms42168 KiB
16Runtime error0/270ms43272 KiB
17Runtime error0/268ms44680 KiB
18Runtime error0/257ms45952 KiB
19Runtime error0/252ms45968 KiB
20Time limit exceeded0/2273ms20548 KiB
21Runtime error0/264ms48672 KiB
22Runtime error0/268ms50204 KiB