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

给后面的人一点提示

Posted by tanbokan at 2008-09-16 09:41:55 on Problem 1935
k为遍历的起始节点,我们把图看成一颗树,k当成树的根。对于每个节点遍历他所有子树,如果子树中包含要遍历的点,那么我们肯定需要走到这个子树上,我们用cost和save表示某个节点走到所有有用的子树并返回所需要花费和某点走到一个子树不返回所需要的花费。那么答案就是根结点cost-save.

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