Page 2 of 3

Mistake

Posted: Fri Oct 17, 2003 5:16 pm
by shahriar_manzoor
Sorry! Although the problem statement says floating point, all the judge inputs are integers. I think in my defense I can say "All integers are floating point numbers" :) like "All alkalies are base" in chemistry days.

Edit

Posted: Sat Oct 25, 2003 8:09 am
by hito
Hi,I want to say something first...my English is pool...
But I got A.C. and also think the problem is beautiful and clear enough...

if r1=r2,
then r1+r2=R=t/2
so R^2=t^2/4
the gray area=(t^2/4)*pi-2*(t^2/16)*pi=(t^2/8)*pi

else r1!=r2
then (r1+r2)^2=(r1-r2)^2+(t/2)^2
we can get 4*r1*r2=(t/2)^2
by the problem,t value must be integer,
so r1=k^2*r2(k is rational number)
if not, t will be irrational number,
so 4*k^2*r2^2=(t/2)^2
then we can got r2=t/4k,r1=tk/4
so the big circle area:
(t/4k + tk/4)^2*pi=(t^2/16k^2+t^2*k^2/16+t^2/8)*pi
the gray area still (t^2/8)*pi....

so the two pictures that post before maybe correct,
but the area of gray part maybe have precision errors,
or it will be the same.

This is my first post here,if I make a mistake,plz let me know.
Hope this will be a little help...

10573 - Help please

Posted: Sat Jan 24, 2004 10:27 pm
by pavelph
As I understand if in input "t" then write “Impossible.” else write area of grey part. Am I right???

Posted: Sun Jan 25, 2004 5:46 am
by shamim
Well not quite.
I will give you one hint, the part about "Impossible" here is only for confusing. My AC program does not consider cases where output will be "Impossible". :wink:

Posted: Sun Jan 25, 2004 7:40 pm
by pavelph
I think that with <const t> and different <Radius of big circle> we will have different answers :-?

10573WA

Posted: Tue Apr 06, 2004 10:29 am
by Eduard
Please help i don't know were is an error i thing my formula is right.
[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:real;
begin
readln(n);
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
read(r[k]);
if k=2 then break;
end;
if j<>n then readln;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end.[/pascal]

10573 Help Please

Posted: Mon Apr 12, 2004 9:55 pm
by Eduard
I put this question in Volume CV, but did not get answer.
I put it here because I think my problem is with input. Plase help me. What is wrong with my program why I'm getting WA.
[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:double;
begin
readln(n);
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
read(r[k]);
if k=2 then break;
end;
if j<>n then readln;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end. [/pascal]

Posted: Tue Apr 13, 2004 3:17 pm
by Observer
No. Your formula for the "one integer" case is wrong. Check that again.

Posted: Tue Apr 13, 2004 4:50 pm
by Eduard
Thank you i did not sea that write the second formula wrong.
I get AC.

10573 error in problem specifications (non integer data!!)

Posted: Tue May 04, 2004 9:26 pm
by MarC
there have been a lot of discussions about this problem...
but, in my opinion, the clue is that in the problem's text, they say "each set contains two integer. If it contains one integer..."
but in the judge's files, there is one test with double data!!!

that's why i got a thousand times WA!

I expect they will fix this error!!!

Posted: Wed May 05, 2004 4:05 am
by UFP2161
No, it says "Each set either contains one or two integer."

Thus, a line like "5 1.1161" contains only one integer, and is technically valid.

10573 Geometry Paradox ~WA

Posted: Wed Aug 31, 2005 3:54 pm
by ansiemens
HI! I always got WA. I don't know whats wrong with it.
can anyone tell me?

Code: Select all

#include<iostream>
#include<sstream>
#include<string>
using namespace std;

const double M_PI=3.14159265358979323846;

int main() {
    int n,r1,r2,t;
    string input;
    cin >> n; cin.ignore();
    cout.setf(ios::fixed);
    cout.precision(4);
    while(n--) {
        getline(cin,input);
        if(input[1]==0 || input[2]==0) {
            istringstream(input) >> t;
            cout << t*t*(M_PI/8.0) << endl;
        }
        else {
            istringstream(input) >> r1 >> r2;
            cout << r1*r2*(2.0*M_PI) << endl;
        }
    }
    return 0;
}

Posted: Fri Sep 09, 2005 11:45 am
by Sedefcho
The formulas you use are obviously OK.
Try to simplify the way you read the input. That should
be your problem. You may want to use simpler functions
( pure C functions ) like gets() and sscanf().

Re: 10573 - Geometry Paradox(precisition error.pliz anyone help)

Posted: Sun May 04, 2008 12:40 am
by kbr_iut
code deleted.Now AC,thanx obaida

Re: 10573 - Geometry Paradox

Posted: Sun May 04, 2008 6:21 am
by Obaida
If only t is given, you can assume that r1 = r2, t become the diameter of the outer circle :) Thus the area of the outer circle becomes PI*(t/2)*(t/2) and area of the two identical inner circles become 2*PI*(t/4)*(t/4), thus the area of the gray part = (PI*t*t)/4 - (PI*t*t)/8 = (PI*t*t)/8.
If there are r1 and r2, then gray part =2*PI*r1*r2.
And there is no impossible case. 8)