How can I solve this range quarry problem?

Правка en1, от gs15120, 2020-08-03 08:53:05

Let array a1,...,an, (1<=n<=10^6)

3 kinds of quarries, m in total (1<=m<=10^6)

1 l r k: add k to al,...,ar 2 l r k: change ai (l<=i<=r) in to max(ai,k) 3 l r: print max(al,...,ar)

I think it could be done it at mlogn by segment tree. How can I?

Теги #segment tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский gs15120 2020-08-03 08:59:17 4
en2 Английский gs15120 2020-08-03 08:54:10 24
en1 Английский gs15120 2020-08-03 08:53:05 297 Initial revision (published)