111142024-07-07 10:11:45probaFasor (40)python3Runtime error 0/4097ms27668 KiB
#fak
'''
sor1 =[int(i) for i in '10 3'.split(' ')]
sor2 = [int(i) for i in '6 2 1 8 4 8 7 12 9 3'.split(' ')]
'''
sor1 =[int(i) for i in input().split(' ')]
sor2 = [int(i) for i in input().split(' ')]

N, k, i = sor1[0], sor1[1], 0

def lat(p):
    j, ok = -k, True
    
    while j < k and ok:
        if j-k < 0:
            h1 = 0
        if j+k > N:
            h2 = N
        if max(sor2[h1:h2]) > sor2[p]:
            ok = False
        j += 1
    return j != k
    
    
while i<N and lat(i):
    i+= 1
    
print(i+1)    
    
SubtaskSumTestVerdictTimeMemory
base0/40
1Runtime error0/018ms3048 KiB
2Runtime error0/021ms4196 KiB
3Runtime error0/218ms3048 KiB
4Runtime error0/217ms3044 KiB
5Runtime error0/218ms3044 KiB
6Runtime error0/217ms3044 KiB
7Runtime error0/218ms2952 KiB
8Runtime error0/218ms3300 KiB
9Runtime error0/220ms4196 KiB
10Runtime error0/221ms4240 KiB
11Runtime error0/220ms4168 KiB
12Runtime error0/220ms3940 KiB
13Runtime error0/252ms14556 KiB
14Runtime error0/257ms14708 KiB
15Runtime error0/287ms27220 KiB
16Runtime error0/286ms26068 KiB
17Runtime error0/289ms26332 KiB
18Runtime error0/297ms26472 KiB
19Runtime error0/289ms27668 KiB
20Runtime error0/248ms11728 KiB
21Runtime error0/292ms26116 KiB
22Runtime error0/297ms25008 KiB