KING-SEN's blog

By KING-SEN, history, 10 years ago, In English

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

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

»
10 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

I guess this could be the problem

memset(ara, 0, n);
memset(lazy, 0, 3*n);
»
10 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Please recommend some good tutorials for segment tree and binary indexed tree?