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

求大神解释...T_T(为什么都没有P的...)

Posted by hsez_zyf at 2011-10-08 23:30:42 on Problem 2507
program p2507;
var
x,y,c,l,r,mid,f,h1,h2:double;

function min(i,j:real):double;
begin
 if i<j then
  exit(i);
 exit(j);
end;

begin
 while not(eof) do
  begin
 readln(x,y,c);
 l:=0;
 r:=min(x,y);

 while r-l>0.000001 do
  begin
   mid:=(l+r)/2;
   h1:=sqrt(abs(x*x-mid*mid));
   h2:=sqrt(abs(y*y-mid*mid));
   f:=h1*h2/(h1+h2);
   if f>c then
    l:=mid+0.000001
   else
    r:=mid-0.000001;
  end;
 writeln(l:0:3);
 end;
end.


我都精确到这么多了...交了一晚上都没过啊...T_T

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