Moderator: Board moderators

shahriar_manzoor
Posts: 399
Joined: Sat Jan 12, 2002 2:00 am

Mistake

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.

hito
New poster
Posts: 1
Joined: Sat Oct 25, 2003 7:39 am
Location: Taiwan

Edit

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...

pavelph
Learning poster
Posts: 57
Joined: Wed Dec 10, 2003 7:32 pm
Location: Russia, Saint-Petersburg

As I understand if in input "t" then write “Impossible.” else write area of grey part. Am I right???

shamim
A great helper
Posts: 498
Joined: Mon Dec 30, 2002 10:10 am
Location: Bozeman, Montana, USA
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".

pavelph
Learning poster
Posts: 57
Joined: Wed Dec 10, 2003 7:32 pm
Location: Russia, Saint-Petersburg
I think that with <const t> and different <Radius of big circle> we will have different answers

Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

10573WA

[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:real;
begin
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
if k=2 then break;
end;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end.[/pascal]
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650

Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

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
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
if k=2 then break;
end;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end. [/pascal]
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong
No. Your formula for the "one integer" case is wrong. Check that again.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan
Thank you i did not sea that write the second formula wrong.
I get AC.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650

MarC
New poster
Posts: 1
Joined: Tue May 04, 2004 9:05 pm
Contact:

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

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!!!

UFP2161
A great helper
Posts: 277
Joined: Mon Jul 21, 2003 7:49 pm
Contact:
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.

ansiemens
New poster
Posts: 6
Joined: Tue Aug 09, 2005 11:24 am
Location: New York, NY

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;
}``````

Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria
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().

kbr_iut
Experienced poster
Posts: 103
Joined: Tue Mar 25, 2008 11:00 pm
Contact:

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

code deleted.Now AC,thanx obaida
Last edited by kbr_iut on Sun May 04, 2008 8:11 am, edited 1 time in total.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................

Obaida
A great helper
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am