第二题应该是树形DP,和 https://www.luogu.com.cn/problem/P2014 类似

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务