SPOJ QTREE — Runtime Error [HLD + SEGMENT TREE]

Revision en1, by PiasRoY, 2019-10-09 12:05:15

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?

Tags hld, spoj, spoj qtree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English PiasRoY 2020-04-14 17:49:40 3 Tiny change: 'oblem was my 'decom' -> 'oblem was in my 'decom'
en2 English PiasRoY 2019-10-29 00:21:39 176
en1 English PiasRoY 2019-10-09 12:05:15 456 Initial revision (published)