From 04c141b2c18bcd77491f2f6c870b965968330cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Fri, 19 Jan 2024 08:25:35 +0800 Subject: [PATCH] 'commit' --- TangDou/Topic/HuanGenDp/SubTree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TangDou/Topic/HuanGenDp/SubTree.cpp b/TangDou/Topic/HuanGenDp/SubTree.cpp index 57d1386..3970dc7 100644 --- a/TangDou/Topic/HuanGenDp/SubTree.cpp +++ b/TangDou/Topic/HuanGenDp/SubTree.cpp @@ -34,6 +34,12 @@ void dfs1(int u, int fa) { son.push_back(v); // 将子节点加入集合,方便之后操作 } + //这里面的t1,t2,其实也可以不用: + //pre[son[0]]:1 + //pre[son[1]]: pre[son[0]] * (f[son[1]] + 1) % mod + //... + //pre[son[i]]: pre[son[i-1]] * (f[son[i]] + 1) % mod + int t1 = 1; // 前缀积取模后的值 int t2 = 1; // 后缀积取模后的值