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

还能优化一点点,最后可以0ms

Posted by tzkq at 2009-09-22 01:07:31 on Problem 1040
In Reply To:Re:Time Limit Exceed 哪位高人给个好的算法 Posted by:wrong123 at 2006-01-06 21:35:19
降排序后计算remain时,一般都是倒序逐位相加,这里可以稍微优化。

因为题目有条件,不能>capacity, 这样一来使得remain减小,加强了剪枝。


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