← 返回 bytedance 的题目列表Equalizing Root-to-Leaf Path Weights in Weighted Trees
类型:online_judge
bytedance
Given a binary tree where each edge has a weight, you can increase the weight of any edge. The goal is to equalize the path weights from the root node to every leaf node by adding the minimum total weight possible. Design an algorithm to solve this problem and analyze its time complexity.
Example
Input
3
1 1