Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3862 Accepted: 2171 Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure…
<题目链接> 题目大意: 一个 $n$ 个节点 $m$ 条边的无向连通图,每条边有一个边权 $w_i$.现在她想玩一个游戏:选取一个 “重要点” S,然后选择性删除一些边,使得原图中所有除 S 之外度为 1 的点都不能到达 S.定义删除一条边的代价为这条边的边权,现在 Rinne 想知道完成这个游戏的最小的代价.(2≤S≤N≤10^5,M=N−1,保证答案在 C++ long long 范围内) 解题分析: 因为该无向图连通,并且$n=m+1$,所以该图一定是一颗树.我们可以用树形DP解决本…
Anniversary party Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4310 Accepted Submission(s): 1976 Problem Description There is going to be a party to celebrate the 80-th Anniversary of the…