I am trying to solve MSTICK problem from May Challenge 2013
I tried normal segment trees (without lazy propagation) but kept getting SIGSEGV.
While debugging, I tried to vary memory allocations. These are the two codes I wrote
(Differences are mentioned in comments in the codes)
These are completely identical to each other except for memory allocation techniques used. And still, they are giving different answer to the same input.
Could anyone explain why is it so?