Heavy-Light Decomposition with segment tree.↵
↵
Do you flatten the tree by DFS (prioritizing the heavy child) and use a single segment tree over the whole array, [likes:1]↵
↵
or build a separate segment tree for each chain? [likes:2]
↵
Do you flatten the tree by DFS (prioritizing the heavy child) and use a single segment tree over the whole array, [likes:1]↵
↵
or build a separate segment tree for each chain? [likes:2]



