Блог пользователя meintoo

Автор meintoo, 10 лет назад, По-английски

Hey everyone !! I m trying to solve HORRIBLE on spoj but I m getting WA again and again !! I m just not getting where am I getting wrong in my approach !! I have recoded it several times but I can't get the bug in my approach !! Here is the link to my code . Do have a look guys .
Thanks in advance .
P.S — I think code is clean and can be understood easily .

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
10 лет назад, # |
Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

"You are given an array of N elements, which are initially all 0."
Just add
memset(lazy, 0, sizeof(lazy));
memset(tree, 0, sizeof(tree));
before working upon each test case to be sure that your segment tree is filled with zeroes in the beginning.
Code