摘要: 题面:https://www.luogu.org/problemnew/show/P2015 cpp 设f[u][i]表示u的子树上保留i条边,至多保留的苹果数目 那么状态转移方程也就显而易见了: f[u][i]=max(f[u][i],f[u][i−j−1]+f[v][j]+e[i].w)( 1≤ 阅读全文
posted @ 2019-07-23 14:19 prestige 阅读(123) 评论(0) 推荐(0) 编辑
摘要: ```cpp 【题目描述】: 有根树在计算机科学工程领域是一个人人熟知的数据结构类型。下面是一个例子。 8 (1,4,5);1 (13,14);4 (6,10);5 (9);6 (7,15);10 (2,11,16);16 (3,12); 在这个图中,每个点都是由{1, 2,...,16}中的某个数 阅读全文
posted @ 2019-07-23 14:15 prestige 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 题面:https://www.luogu.org/problemnew/show/P3178 cpp Code: include include include include include include using namespace std; const long long N=100005 阅读全文
posted @ 2019-07-23 14:14 prestige 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 题面:https://www.luogu.org/problemnew/show/P2590 cpp Code: include include include include include include using namespace std; const int N=100005,INF=1 阅读全文
posted @ 2019-07-23 14:13 prestige 阅读(206) 评论(0) 推荐(0) 编辑