113382024-08-20 11:10:21probaFasor (40)python3Wrong answer 8/40300ms28172 KiB
'''
sor1 = list(map(int, '10 3'.split(' ')))
sor2 = list(map(int, '20 19 18 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]; pos = tav

while pos < len(sor2)-tav and (max(sor2[pos-tav:pos]) > sor2[pos] or max(sor2[pos+1:pos+tav]) > sor2[pos]):
    #print(pos-tav, '-', max(sor2[pos-tav:pos]),'[',pos,'-',sor2[pos],']', pos+tav)
    pos += 1
#print(pos-tav, '-', max(sor2[pos-tav:pos]),'[',pos,'-',sor2[pos],']', pos+tav)    
print(pos+1)
SubtaskSumTestVerdictTimeMemory
base8/40
1Accepted0/018ms2988 KiB
2Accepted0/020ms4112 KiB
3Wrong answer0/218ms2916 KiB
4Runtime error0/218ms2916 KiB
5Wrong answer0/217ms2916 KiB
6Accepted2/217ms3016 KiB
7Wrong answer0/218ms3080 KiB
8Accepted2/218ms3436 KiB
9Wrong answer0/248ms4084 KiB
10Accepted2/221ms4328 KiB
11Accepted2/221ms4124 KiB
12Wrong answer0/220ms3812 KiB
13Time limit exceeded0/2298ms14688 KiB
14Wrong answer0/248ms14624 KiB
15Time limit exceeded0/2298ms27328 KiB
16Time limit exceeded0/2298ms26016 KiB
17Time limit exceeded0/2296ms27656 KiB
18Time limit exceeded0/2298ms28172 KiB
19Time limit exceeded0/2296ms27836 KiB
20Wrong answer0/239ms11216 KiB
21Time limit exceeded0/2300ms26120 KiB
22Time limit exceeded0/2298ms25104 KiB