Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:树形DP一下然后排序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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator