117522024-11-09 01:31:32balintFasor (40)python3Time limit exceeded 20/40300ms26616 KiB
def main():
    n, k = map(int, input().split())
    nums = list(map(int, input().split()))

    for i in range(n):
        if max(nums[max(0, i - k) : min(i + 1 + k, n)]) == nums[i]:
            print(i + 1)
            break
    else:
        print("-1")


main()
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/016ms3064 KiB
2Accepted0/018ms4164 KiB
3Accepted2/216ms2872 KiB
4Accepted2/216ms3008 KiB
5Accepted2/216ms2872 KiB
6Accepted2/216ms2872 KiB
7Accepted2/216ms2996 KiB
8Accepted2/217ms3128 KiB
9Accepted2/218ms4152 KiB
10Accepted2/218ms4052 KiB
11Accepted2/220ms4184 KiB
12Accepted2/217ms4088 KiB
13Time limit exceeded0/2300ms14764 KiB
14Time limit exceeded0/2300ms14656 KiB
15Time limit exceeded0/2300ms26616 KiB
16Time limit exceeded0/2300ms26156 KiB
17Time limit exceeded0/2280ms26324 KiB
18Time limit exceeded0/2280ms26332 KiB
19Time limit exceeded0/2280ms25028 KiB
20Time limit exceeded0/2280ms11060 KiB
21Time limit exceeded0/2293ms26128 KiB
22Time limit exceeded0/2293ms25008 KiB