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 |
其实还有种简单些的方法……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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator