Assigning a value on a range using lazy propagation

Правка en1, от 21August, 2019-08-02 12:17:18

Hi everyone. Can somebody provide an working code of a segment tree that supports following operations:

  1. Subtract value on suffix of array.
  2. Assign a range with the smallest element in that range.

It is guaranteed that the array is always sorted in ascending order after each operation. I would like a code that implements this using lazy propagation. I tried to write such a code for the problem Jousting tournament . Here is a code of the segment tree. Also i have a function "kth" that find the last occurrence of a value in the array. The functions "up" , "push", "build" are used for this part of the problem. Please help to debug or give me another code.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский 21August 2019-08-02 12:17:18 803 Initial revision (published)