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

二分

Posted by The_Dawn at 2011-07-08 11:07:11 on Problem 3273
定义所有天数的花费和为sum. 则二分的左边界为0,右边界为sum.
每次取中点mid作为尝试,如果能mid能满足题意要求,则r=mid,否则l=mid+1
注意如果天数中有任何一天的数值大于mid则当前mid不可用.

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