http://www.spoj.com/problems/HORRIBLE/ Hi everybody, I want to solve this problem with segment tree lazy propagation. I code it with segment tree lazy propagation but it gives me a wrong answer.I check it but I am unable to find any bug. Please anyone can help me to check my code and give me any solution for it.
code link: http://codepad.org/0LePV2tI
I guess this could be the problem
I replace the memset(ara, 0, sizeof (ara)); and memset(lazy, 0, sizeof(lazy)); But worng answer.
Check your query function! It might overflow
Please recommend some good tutorials for segment tree and binary indexed tree?