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

不需要treedp...

Posted by Ginforward at 2008-10-24 21:00:52 on Problem 2378
选一个度最大的节点做根..然后DFS一次记录下每个节点下的儿子数..
然后再枚举每个点.这么算一下就可以了..虽然最坏情况O(n^2)..不过数据比较弱..

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