How to solve SPOJ QTREE4 by HLD?

Revision en2, by rhezo, 2016-09-21 11:32:25

I was reading anudeep2011's blog.

He mentioned 2-3 lines down below to solve QTREE4 using HLD. I didn't understand it, can some explain it to me, please?

Here is the link to the problem.

I read elsewhere, that it can be solved by Centroid Decomposition too, but I need to understand the HLD approach.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English rhezo 2016-09-24 13:40:09 14 Tiny change: 'minimum). ' -> 'minimum). \n\nAnyone? :|'
en3 English rhezo 2016-09-21 15:26:55 197
en2 English rhezo 2016-09-21 11:32:25 117
en1 English rhezo 2016-09-21 11:28:47 343 Initial revision (published)