I need helps about a segment tree dp problem with queries!!!

Revision en1, by tminh_hk20, 2023-10-30 21:21:48

+) Problem: You have an array with N elements and Q queries. For each query, you update the value of range [l, r] by x, a[l], a[l+1],...,a[r] will become to a[l]+x, a[l+1]+x,...a[r]+x. After the query, you need to find the RES (Cutting the range The above number into segments, and the RES is equal to the total value of the segments. The value of A segment is defined by the difference between the largest and smallest numbers in that segment) +) N, Q<=2e5 +) -1e8<=a[i],x<=1e8

If you know some problem like this problem in Code force, I want you can share it for me.

I'm sorry about my English, Thank you for all!

Tags dp, segment tree, query, hard problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English tminh_hk20 2023-10-30 21:21:48 685 Initial revision (published)