123842024-12-16 07:44:27birozsFasor (40)python3Runtime error 36/40174ms27092 KiB
N,K=map(int,input().split())
lista = list(map(int,input().split()))
maxertek = [lista[0]]
for i in range(1,N):
    if lista[i] > maxertek[i-1]:
        maxertek.append(lista[i])
    else:
        maxertek.append(maxertek[i-1])
van = False
for i in range(N):
    if i - K < 0:
        bal = 0
    else:
        bal = i - K
    if i + K > N:
        jobb = N-1
    else:
        jobb = i + K
    if maxertek[bal] <= maxertek[i] >= maxertek[jobb]:
        print(i+1)
        van = True
        break
if not van:
    print(-1)
SubtaskSumTestVerdictTimeMemory
base36/40
1Accepted0/016ms3128 KiB
2Accepted0/021ms4312 KiB
3Accepted2/216ms3116 KiB
4Runtime error0/216ms3128 KiB
5Accepted2/217ms3132 KiB
6Accepted2/216ms3036 KiB
7Accepted2/216ms3204 KiB
8Accepted2/217ms3384 KiB
9Accepted2/221ms4148 KiB
10Accepted2/220ms4096 KiB
11Accepted2/221ms4268 KiB
12Accepted2/220ms4016 KiB
13Accepted2/2112ms14792 KiB
14Accepted2/2123ms14680 KiB
15Accepted2/2152ms27092 KiB
16Accepted2/2145ms26192 KiB
17Accepted2/2151ms26336 KiB
18Accepted2/2153ms26332 KiB
19Accepted2/2174ms26352 KiB
20Runtime error0/286ms11196 KiB
21Accepted2/2150ms26156 KiB
22Accepted2/2149ms25048 KiB