(树形DP)tree of tree (zju)

题意,一棵树中有N个结点(最多为100个结点)。每一个结点有一个树值ios 求该树的子树结点最多为K个的全部权值和最大是多少。spa 思路:用dp[cur][K]记录包含当前结点与其子树所造成的子树的最大值。code #include<cstdio> #include<iostream> #include<cstring> #include<queue> #include<string> #inc
相关文章
相关标签/搜索