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:Re:up Posted by:cuiaoxiang at 2007-10-07 12:45:32 > f[x]表示从x到root的每条边都加f[x] > 那么x---y的每条边加1 > 就可以用f[x]++, f[y]++, f[LCA(x,y)]-=2;来表示 > 最后treeDP一下,统计每条边的值就可以了 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator