Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大水题。只要找出所有经过的边,总和乘上2,然后减去一条到某个点距离最大的值,就是答案In Reply To:经典树形DP Posted by:yc5_yc at 2012-11-09 21:59:25 > 类似Apple Tree > 方程: > dp[a][0]=sum{dp[i][0] > +(2*dist{i,a}|i is in M or dp[i][0]!=0)}(i is a child of a) > dp[a][1]=dp[a][0] > -max{dp[i][0]-dp[i][1] > +(dist{i,a}|i is in M or dp[i][0]!=0)}(i is a child of a) Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator