111132024-07-07 10:06:09probaFasor (40)python3Wrong answer 14/40296ms27788 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 > -1 and j+k < N:
            if sor2[j+k] > sor2[p]:
                ok = False
        j += 1
    return j != k
    
    
    
while i<N and lat(i):
    i+= 1
    
print(i+1)    
    
SubtaskSumTestVerdictTimeMemory
base14/40
1Accepted0/018ms3044 KiB
2Accepted0/021ms4268 KiB
3Accepted2/217ms3044 KiB
4Wrong answer0/218ms3060 KiB
5Accepted2/218ms3044 KiB
6Accepted2/217ms3044 KiB
7Accepted2/218ms3320 KiB
8Wrong answer0/218ms3320 KiB
9Accepted2/220ms4388 KiB
10Accepted2/221ms4212 KiB
11Wrong answer0/229ms4368 KiB
12Accepted2/219ms3812 KiB
13Time limit exceeded0/2296ms15296 KiB
14Time limit exceeded0/2291ms15368 KiB
15Time limit exceeded0/2296ms27060 KiB
16Time limit exceeded0/2293ms27432 KiB
17Time limit exceeded0/2293ms27788 KiB
18Time limit exceeded0/2289ms27680 KiB
19Time limit exceeded0/2289ms26624 KiB
20Time limit exceeded0/2291ms11644 KiB
21Time limit exceeded0/2294ms27228 KiB
22Time limit exceeded0/2291ms26316 KiB