CF219D Choosing Capital for Treeland-CSDN博客CF219D Choosing Capital for Treeland这道题一开始觉得比较毒瘤,但是想一下还是想的出来的。我们考虑定义\(dp[i][0]\)代表到点\(i\)所有子节点的最小权值,\(dp[i][1]\)代表到点\(i\)子树外所有节点的最小权值。那么显然有:\(dp[i][0]=\sum _{t\...... admin2023-10-12