Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

dp+二分,估计是很2B的做法...

Posted by csu_yx at 2011-12-10 02:17:25 on Problem 1655
没写邻接表,直接保存了所有的边,应该是2*(nN - 1)的边,
每个边绑定一个ans,再排序所有边,
然后递归dp,最好笑的是查找相邻结点时候,开始用了STL的find,超时,然后看了下手册发现居然是顺序查找,改成bsearch和qsort了,果断157ms过了。。。
除以2分查找的时候,应该速度还不错。。。
好二的样子,过程无限曲折啊。。。。
刚开始直接邻接矩阵开几千万的数组,直接system error了。。。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator