help in cses problem : range update and sums

Revision en1, by arham_doshi, 2020-07-15 18:56:50

need help in this question. question ask you to implement two types of lazy trees one for update and one for sum. I did all I could but i am unable to find the bug. please help me .

my code
test case
required ans
my answer


it would also be help full if you know some blog or toutorial to solve similar problem. thanks in advance guys for helping.

Tags cses, #segment tree, #advance data structures, #lazy propagation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English arham_doshi 2020-07-15 21:00:37 3592 Tiny change: ';\n // cout<<endl;\n }\' -> ';\n \n }\'
en2 English arham_doshi 2020-07-15 19:01:00 10 Tiny change: ' if(laz[p]!=0){\n' -> ' if(change[p]!=0){\n'
en1 English arham_doshi 2020-07-15 18:56:50 9313 Initial revision (published)