Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

大水题。只要找出所有经过的边,总和乘上2,然后减去一条到某个点距离最大的值,就是答案

Posted by yygy at 2012-11-10 00:19:16 on Problem 1935
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator