113372024-08-20 09:44:54probaFasor (40)python3Runtime error 4/40184ms32000 KiB
'''
sor1 = list(map(int, '10 3'.split(' ')))
sor2 = list(map(int, '6 2 1 8 4 8 7 12 9 3'.split(' ')))
'''
sor1 = list(map(int, input().split(' ')))
sor2 = list(map(int, input().split(' ')))

tav = sor1[1]

def szetkap(sor, t, p):
    
    mp = sor.index(max(sor))
    #print(mp-t, mp+t, len(sor), mp)
    if mp-t >= 0 and mp+t <= len(sor)-1:
        #print('ok')
        if p == -1:
            p = mp
        elif mp < pos:
            p = mp
        
    if mp-t >= 0:
        #print(sor[:mp])
        p = szetkap(sor[:mp], t, p)
    return  p

    
p = szetkap(sor2, tav, -1)

print(p+1)
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/021ms4296 KiB
2Runtime error0/027ms6404 KiB
3Wrong answer0/223ms4824 KiB
4Wrong answer0/221ms4216 KiB
5Wrong answer0/218ms3044 KiB
6Runtime error0/217ms3184 KiB
7Wrong answer0/217ms3044 KiB
8Runtime error0/218ms3448 KiB
9Wrong answer0/221ms4156 KiB
10Runtime error0/220ms4196 KiB
11Runtime error0/220ms4196 KiB
12Wrong answer0/219ms3888 KiB
13Accepted2/2103ms19792 KiB
14Wrong answer0/250ms15312 KiB
15Wrong answer0/2123ms28204 KiB
16Wrong answer0/2179ms30536 KiB
17Wrong answer0/2172ms31524 KiB
18Accepted2/2184ms32000 KiB
19Runtime error0/292ms29184 KiB
20Wrong answer0/246ms11964 KiB
21Wrong answer0/290ms27100 KiB
22Wrong answer0/289ms26376 KiB