Блог пользователя new_algos

Автор new_algos, история, 5 лет назад, По-английски

You are given an array of n integers. Your task is to calculate the median of each window of k elements, from left to right.

The median is the middle element when the elements are sorted. If the number of elements is even, there are two possible medians and we assume that the median is the smaller of them.

1≤k≤n≤2⋅105

1≤xi≤109

Полный текст и комментарии »

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится