SPOJ Qtree5 solution using HLD

Правка en1, от yusayura, 2018-06-27 19:35:23

Hey there! I've recently been learning heavy light decomposition, and I read somewhere that SPOJ QTREE5 problem can be solved using this data structure;

I tried to find a good solution to this problem with HLD but wasn't much successful, so I will appreciate it if somebody gives me a little hint on solving it by heavy light decomposition.

By the way, my own solution was a really scary and hard_to_implement one, using tons of DPs and segment trees and I'm not sure if I can code it at the first place :(

Thanks in advance :)

Теги #spoj, qtree5, hld

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский yusayura 2018-06-27 19:36:44 37 Tiny change: 'ms/QTREE5/https://www.spoj.com/problems/QTREE5/' -> 'ms/QTREE5/'
en1 Английский yusayura 2018-06-27 19:35:23 645 Initial revision (published)