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

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

Given a sorted array A of n elements. We are given n queries of the type [l, r] where l and r are the indices. 0 <= l , r < n In each query, we have to find out the mode in the range [l,r] both inclusive. We can use no more than n * log(n) memory and the solution should run in n * log(n) time.

Can we do it in given constraints on memory and time?

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

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