洛谷2015(树形dp) 要点是树形的考虑dfs分为取一枝,取两枝两种情况,将它们的合法情况进行暴举取最好答案即可,貌似我乱搞得相当冗……顺手记忆化正解应该是树上背包#include <cstdio>#include <cstring>#include <algorithm>#include <functional>#include <v... Other 2023-11-15 58 点赞 0 评论 87 浏览