| ||||||||||
| 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 | |||||||||
对,就是O(N). 先dfs造一棵树.然后从叶往父结点添加人数.每个结点记录它多带出的子树的人数.对于每个结点,取abs((total-now)-now)就是差值了...然后记录一个minIn Reply To:Re:复杂度只为O(N),应该不会超时 Posted by:byron at 2006-11-23 12:18:07 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator