164992025-05-03 18:51:10algoproFasor (40)pypy3Accepted 40/4098ms44156 KiB
# UUID: 36475118-1d3b-4240-b654-d873fb64b9da
#apa

n,k=[int(x) for x in input().split()]
h=[int(x) for x in input().split()]
i=0

futas=True
while futas:
    futas=False
    for j in range(k):
        if i+j+1>=n:
            break
        if h[i+j+1]>h[i]:
            i=i+j+1
            futas=True
            break


print(i+1)
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/039ms19436 KiB
2Accepted0/048ms21464 KiB
3Accepted2/243ms19408 KiB
4Accepted2/243ms19332 KiB
5Accepted2/245ms19432 KiB
6Accepted2/239ms19436 KiB
7Accepted2/239ms19756 KiB
8Accepted2/252ms21400 KiB
9Accepted2/246ms21468 KiB
10Accepted2/246ms21292 KiB
11Accepted2/254ms21372 KiB
12Accepted2/252ms21384 KiB
13Accepted2/267ms31200 KiB
14Accepted2/265ms31952 KiB
15Accepted2/294ms40960 KiB
16Accepted2/294ms43032 KiB
17Accepted2/285ms43916 KiB
18Accepted2/285ms43888 KiB
19Accepted2/298ms44080 KiB
20Accepted2/274ms31532 KiB
21Accepted2/282ms40952 KiB
22Accepted2/282ms44156 KiB