From 8d4b6f6c39cc8ea8df78af4175d0591807b19b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Tue, 16 Jan 2024 10:11:01 +0800 Subject: [PATCH] 'commit' --- TangDou/Topic/HuanGenDp/CF1187E.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TangDou/Topic/HuanGenDp/CF1187E.cpp b/TangDou/Topic/HuanGenDp/CF1187E.cpp index caf0283..bf072f7 100644 --- a/TangDou/Topic/HuanGenDp/CF1187E.cpp +++ b/TangDou/Topic/HuanGenDp/CF1187E.cpp @@ -49,7 +49,9 @@ signed main() { dfs1(1, 0); // f[i]:以1为根时的, 以i为根的子树可以获得的最大权值 // g[i]:不管以谁为根,以i为根的子树可以获得的最大权值,也就是最终的结果存储数组 - g[1] = f[1]; + g[1] = f[1]; // g[1] + + // 第二次dfs,换根 dfs2(1, 0); // 遍历一遍历,找出到底以谁为根可以获取到权值的最大值,最大值是多少