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

对,就是O(N). 先dfs造一棵树.然后从叶往父结点添加人数.每个结点记录它多带出的子树的人数.对于每个结点,取abs((total-now)-now)就是差值了...然后记录一个min

Posted by ziliang at 2006-11-24 15:17:27
In Reply To:Re:复杂度只为O(N),应该不会超时 Posted by:byron at 2006-11-23 12:18:07


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