| ||||||||||
| 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:这题一定要用right才能ac...二分的输出应该怎么确定啊?In Reply To:这题一定要用right才能ac...二分的输出应该怎么确定啊? Posted by:iYao at 2010-05-17 21:13:42 你可以每次在确定了一个可行解后将它用ans记录一下,最后再输出ans就行。
while l<=r do
begin
mid:=(l+r)div 2;
if OK(mid) then begin ans:=mid;l:=mid+1; end else r:=mid-1;
end;
writeln(ans);
这样..
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator