The_Pandemy_01's blog

By The_Pandemy_01, history, 4 weeks ago, In English,

Hello Guys, I just started learning Lazy propagation and I wanted to practice with a problem I chose SUM of Squares with segment tree in SPOJ. Sum Squares problem ...

I have written the full code present here My Code but I have a strange error when I put the following input 1 4 12 1 2 3 4 1 1 4 1 2 4 4 As output of 2 4 4 query I get 23 and it is supposed to be 25 bcause 4 is incremented by 1 and its square is 25. I reviewed the code for 2 hours but coudn't find the mistake I will be extremely grateful if You can tell me my mistake. Thanks

 
 
 
 
  • Vote: I like it
  • -13
  • Vote: I do not like it