5 人解决,11 人已尝试。
6 份提交通过,共有 83 份提交。
8.3 EMB 奖励。
单点时限: 2.0 sec
内存限制: 1024 MB
A tree is a connected undirected graph without cycles. A weighted tree has a weight assigned to each edge. The distance between two vertices is the minimum sum of weights on the path connecting them.
Cuber QQ has two weighted trees
Cuber QQ proposes a new distance, Two-Tree Distance (TTD), where
Now, for each vertex
The first line contains a single integer
Each of the next
Each of the next
The output contains
5 1 2 1 2 4 2 3 4 3 4 5 4 1 2 2 1 3 3 1 4 4 2 5 5
3 3 9 7 11
5 人解决,11 人已尝试。
6 份提交通过,共有 83 份提交。
8.3 EMB 奖励。
创建: 2 年,5 月前.
修改: 2 年,5 月前.
最后提交: 1 月,4 周前.
来源: N/A