| ||||||||||
| 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 | |||||||||
经典树形DP类似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