ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1084. Goat in the Garden

why wa
Posted by Ras Misha [t4ce] 7 Dec 2006 19:02
it's my code:
------------------------------
{deleted}
------------------------------


Edited by author 09.12.2006 21:18
Re: why wa
Posted by Ras Misha [t4ce] 9 Dec 2006 21:18
i find my mistake
Where is Wrong answer #3
Posted by <>|>|/|<|>>|<<>|-| 10 Dec 2006 01:06
#include<iostream>
#include<math.h>

int main()
{
 using namespace std;

 long j=1,k,R,L;
 double s,pi=3.1415926535;
  cin>>L>>R;

   if(L>=2*R)
    s=pi*R*R;
 else
     if (R>(L*sqrt(2.0))/2) s=L*L;
else
 s=2*R*R*atan((L*L-2*R*R)/(L*sqrt((double) 4*R*R-L*L)))+L*sqrt((double) 4*R*R-L*L);

k=s;

while(k>10)
   {
   k=k/10;
   j++;
   }
   cout.precision( 3+j );
   cout << noshowpoint << s << endl;

 return 0;
}


Помоги мне . . .

Edited by author 10.12.2006 01:07
AC!!!
Posted by And IV (ucs-usty-forever) 15 Apr 2007 01:56
program _1084;

{$APPTYPE CONSOLE}

uses
  SysUtils,math;
const
 pi=3.1415926535;
Var
x,l,s,c:real;
begin
  Readln(x,l);
  X:=x/2;
  c:=x*sqrt(2);
  if l>=c then s:=4*x*x;
  if l<=x then s:=pi*l*l;
  if not((l>=c)or(l<=x)) then
   Begin
     s:=8*(x*sqrt(l*l-x*x)/2+l*l/2*(pi/4-arccos(x/l)))
   end;
  writeln(s:0:3);
end.
Re: AC!!!
Posted by Eyyub A O T L . 24 Nov 2007 16:42
And IV (ucs-usty-forever) wrote 15 April 2007 01:56
program _1084;

{$APPTYPE CONSOLE}

uses crt;
const
 pi=3.1415926535;
Var
x,l,s,c:real;
begin
  Readln(x,l);
  X:=x/2;
  c:=x*sqrt(2);
  if l>=c then s:=4*x*x;
  if l<=x then s:=pi*l*l;
  if not((l>=c)or(l<=x)) then
   Begin
     s:=8*(x*sqrt(l*l-x*x)/2+l*l/2*(pi/4-arccos(x/l)))
   end;
  writeln(s:0:3);
end.

Edited by author 24.11.2007 16:45

Edited by author 24.11.2007 16:45