链接:
https://ac.nowcoder.com/acm/contest/57361/B
来源:牛客网
Given a rooted tree with
nnn nodes. Each edge has a weight and initially all weights are
000.
You need to perform
mmm operations. In each operation you are given three integers
l,r,xl,r,xl,r,x, which means you need to find the smallest connected component in the tree that contains all nodes in the range
[l,r][l,r][l,r], and add
xxx to the weights of edges in this connected component.
After all operations are performed, output the weights of all edges.