need help in spoj problem

Can someone help me with this [problem][1] on spoj. I have done this problem using lazy propagation and was trying to implement less efficient simple point update for range. Can someone tell me the problem with my

Even the sample test case is not passing :(.


but why is my approach giving wrong answer for sample test case.
I am using the same approach as mentioned in hackerearth link text


This should solve the problem.

1 Like

does this mean that both gfg and hackerearth gave wrong code for updation of range by modifying update function (without lazy propagation)
gfg link

look before lazy propagation in above link
Help me this confusion is troublesome.

Yes if standalone, no if you supplement it with lazy propagation. They are using the previous update function to explain that the update operations are being stalled and will resume once lazy propagation stops being lazy :smiley:

1 Like

gotcha thanks