摘要: Strategic game Time Limit: 2000MS Memory Limit: 10000K Total Submissions: 9313 Accepted: 4368 Description Bob enjoys playing computer games, especiall 阅读全文
posted @ 2018-08-04 17:07 lmjer 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 即在树上做背包 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct my{ int next; int v; }; const int maxn=1000+10; int adj[max 阅读全文
posted @ 2018-08-04 16:09 lmjer 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 换根法思想为, 1,随便找一个点作为根进行dp, 2,再以原来点为根进行dp,此次dp,设最优解为 f[x],那么f[root]=d[root],这是显而易见的 然后再通过找d[son]与f[x]之间关系进行dp 比如本道题,若f[x]已知最优解,那么把son换成根,f[x]的最优解即为 d[v]+ 阅读全文
posted @ 2018-08-04 16:03 lmjer 阅读(1357) 评论(1) 推荐(1) 编辑