SPOJ QTREE — Runtime Error [HLD + SEGMENT TREE]

Правка en3, от PiasRoY, 2020-04-14 17:49:40

Update: The problem was in my 'decompose' function. Its return type was 'int' though I didn't return anything, so I changed it into 'void' and I got AC. Weird but worked.

I tried to solve this problem using HLD and Segment Tree. I didn't find LCA explicitly rather used HLD.

Code: https://pastebin.ubuntu.com/p/BfxMZH9hz3/

This solution gives runtime error. I can't find any reason for this kind of verdict.

I have already read this blog but couldn't understand why my code isn't working.

Can anyone help me?

Теги hld, spoj, spoj qtree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский PiasRoY 2020-04-14 17:49:40 3 Tiny change: 'oblem was my 'decom' -> 'oblem was in my 'decom'
en2 Английский PiasRoY 2019-10-29 00:21:39 176
en1 Английский PiasRoY 2019-10-09 12:05:15 456 Initial revision (published)