From 197cb8411451dd40e8cee4e012a66f589092f1cb Mon Sep 17 00:00:00 2001 From: hanyixuanten Date: Tue, 27 Oct 2026 09:44:55 +0000 Subject: [PATCH] new file: solutions/P1453.md --- solutions/P1453.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 solutions/P1453.md diff --git a/solutions/P1453.md b/solutions/P1453.md new file mode 100644 index 0000000..8067fe0 --- /dev/null +++ b/solutions/P1453.md @@ -0,0 +1,7 @@ +# P1453 城市环路 题解 + +题意可转化为有一棵树,每个节点有权值,一个边两端的点不能同时去,同时 $S, T$ 也不能同时取(断开环上的两个点)。 + +因此可转化两次为[P1352 没有上司的舞会](https://www.luogu.com.cn/problem/P1352#),设 $f_{i, 01}$ 以 $i$ 为根的子树,是否选择本节点的收益,只需[以 $S$ 为根时令 $f_{T, 1} = -\inf$,以 $T$ 为根时令 $f_{S, 1} = -\inf$ 即可。](../P1453.cpp#L17-19) + +[code](../P1453.cpp) \ No newline at end of file