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

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

Hello all

I'm trying to solve the problem http://www.spoj.com/problems/HORRIBLE/ but getting WA again n again. I'm using segment trees with lazy propagation. Can somebody please help figure out my mistake.

Thanks in advance.

Code: http://pastebin.com/aT3pvi3K

-- Thanks to diego_v1

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

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

It's in the memset call. You specified the number of elements of each array, when actually memset asks you for the SIZE of the array, which is number of elements * size of each element.

Change 4*MAX with 4*MAX*sizeof(ll) and you'll get accepted.