2012年7月18日

noi 2003 逃学的小孩 树型DP

摘要: 思路:本题就是求在树上 MAX(dis[A,B]+MIN(dis[A,C]+dis[B,C]))可以证明AB是树上最长链 1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<cstring> 5 using namespace std; 6 #define MAXN 200001 7 struct node 8 { 9 int num; 10 long long weight; 11 node *next; 12 }; 13 node *graph[MAXN], 阅读全文

posted @ 2012-07-18 18:07 myoi 阅读(442) 评论(0) 推荐(0) 编辑

导航