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 hhb at 2009-05-05 21:43:11 on Problem 3417
In Reply To:考虑树的基本环路系统……然后大概是这样…… Posted by:frkstyc at 2007-10-06 21:55:52
dp求每个子树连到子树外的新边的数量。假设为f(n)。
f(n)=n点出发的新边数-lca为n的新边数*2+所有子节点p的f(p)
然后很容易就可以树形dp出结果。。

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