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

树形DP一下然后排序

Posted by ACM06060 at 2007-09-23 18:51:20 on Problem 3380
In Reply To:!!!!!!!真心求教这道题目的算法!!!!!! Posted by:kikif at 2007-09-23 18:48:19
> 我想到的是把图先用邻接表存起来,然后逐个将边删除,比如2,3之间的边删除,
> 然后用深度优先遍历2节点和3节点,分别得到节点数a1,a2,然后a1*a2就是这条边重复的次数
> 最后再将每条边的长度乘上重复的次数进行排序。
> 感觉超级麻烦,而且复杂度极高,做到一半就没办法写了,已经快4K了,我觉得肯定有更好的算法,
> 
> 请大牛们介绍一下,谢谢!!!

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