| ||||||||||
| 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 | |||||||||
二分答案做法var aa,bb,a,b,l,r,mid:longint;
begin
readln(aa,bb);
if aa>bb then
begin a:=bb; b:=aa; end
else
begin a:=aa; b:=bb; end;
l:=a<<1;
r:=b<<1;
while l<r do
begin
mid:=(l+r)>>1;
if mid<a+b then l:=mid+1
else r:=mid;
end;
writeln(l);
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator