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

Re:树形DP一下然后排序

Posted by SHZ at 2007-09-26 12:51:08 on Problem 3380
In Reply To:Re:树形DP一下然后排序 Posted by:dalonghenin at 2007-09-23 19:39:09
> 我是dfs搜索(任取一个节点为根)每个节点的儿子数,对于每条边在dfs后必然一个节点a为父,另一个节点b为儿子),该条边重复的次数就是(b的儿子数+1)*(n-a的儿子数)*2,最后再将重复数乘以边的长度排序,分类输出前k个

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