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

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

Is there an algorithm like RMQ that we can change our array elements??? It means that we have an array with all the elements equal to 0 at first.(number of elements < 1e5) and we have 2 types of queries: 1-change the i'th value 2-give the minimum value in range [li, ri] (number of queries < 1e5) I'm new to programming and found nothing on the web I'll be glad if you help me tnx :)

Теги rmq
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

you can use Segment tree for that, each query can be answered in logn time

you can check this