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:upIn Reply To:up Posted by:RoBa at 2007-10-07 12:16:31 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