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

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

Hello all

Typically lazy propagation and segment tree updates come in the form "increase range l-r by diff". What if you want to update a segment tree like "update range l-r to val". So instead of a difference, you tell it precisely what number to update to.

How would you do this? Is there an article somewhere about this?

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

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

that's a normal segtree, i hope this help you.

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

article
I believe changing the '+='s to '='s is enough