
给定一棵包含 n 个节点的无向连通树,每条边 (u,v) 的权重为正整数 wuv 。树上有 m 个被标记为"红点"的节点。
现在需要在树中选择恰好 2 个节点作为 中心 ,使得所有红点到最近中心的最大带权距离 D 最小。
求该最小的 D 。
By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.