Question on heavy light decomposition

Revision en1, by dhwanilpatel, 2015-10-10 20:15:48

Hi everybody, I am solving this problem on SPOJ and have applied heavy light decomposition for solving it. But I'm getting wrong answer and i've not still understood whats wrong.

The link of my code is here.

Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English dhwanilpatel 2015-10-10 20:15:48 340 Initial revision (published)