Page 3 of 4

Posted: Sun Sep 05, 2004 4:03 pm
by Eduard
Hello everybody
I pass all testes which were given in this topic but still can't get AC. Somebody who solve this problem by Pascal tell me please did you use real or double and give some tests please.
Thanks.

Real Type.

Posted: Sun Sep 05, 2004 8:54 pm
by _.B._
Greetings!
Real Type for everything.
Did you check the I/O in previos post?

Keep posting!

Posted: Sun Sep 05, 2004 9:04 pm
by Eduard
Hello _.B._
Yes my program is giving right answers for your last post I/O.
Please give some more Test cases if you Can.
Thanks.

I\O.

Posted: Sun Sep 05, 2004 10:35 pm
by _.B._
Greetings!
Well, this is all I can think of right now:

Input:

Code: Select all

5
-800.0 -799.9 0.0 0.0 800.0 799.9
-800.0 -799.9 0.0 0.0 800.0 800.0
-99.9 -100.0 -100.0 -99.9 0.0 0.0
0.0 0.0 0.1 0.0 0.0 0.1
0.0 0.0 0.0 0.0 0.0 0.0
Output:

Code: Select all

There is no possible location.
The equidistant location is (-12798400.0, 12799200.0).
The equidistant location is (-50.0, -50.0).
The equidistant location is (0.1, 0.1).
There is an infinity of possible locations.
Hope it helps.

Keep posting!

Posted: Mon Sep 06, 2004 1:56 pm
by Eduard
I can't understand why answer for

0.0 0.0 0.0 0.0 0.0 0.0

is not 0.0 0.0 :o

or for

-800.0 -799.9 0.0 0.0 800.0 799.9

is not 0.0 0.0 :o

But anyway after changing it I got AC. :D

Thanks _.B._

Posted: Mon Sep 06, 2004 2:01 pm
by Per
Eduard wrote:I can't understand why answer for

0.0 0.0 0.0 0.0 0.0 0.0

is not 0.0 0.0 :o
Because in this case, any point is equally close to all three places.
Eduard wrote:or for

-800.0 -799.9 0.0 0.0 800.0 799.9

is not 0.0 0.0 :o
Why should it be? The origin is on distance 0 from point 2, but on distance 1131.3 from the other two points.

Posted: Mon Sep 06, 2004 2:46 pm
by Eduard
Sory for the last test case but for first i think answer is 0.0 and all of three points are in distanse of 0.0 from it.

Posted: Mon Sep 06, 2004 4:04 pm
by Per
Yes, and if the firestation is located at (1,0), the distance from all three points to it is 1, and if it is located at (1246, 472), the distance from all three points to it is 1332.4, and so on... any point is a possible location.

Good!

Posted: Mon Sep 06, 2004 4:22 pm
by _.B._
Eduard wrote:But anyway after changing it I got AC. :D
Good! 8)
Maybe you can say what was your mistake, so others can check for it too :wink:

Keep posting!

Posted: Mon Sep 06, 2004 5:42 pm
by Eduard
I can give I think such good advice.This is for numbers like 0.05 which is 0.1.
If your answers are X,Y then do this.
[pascal]
if x>0 then x:=x+0.00000000001 else x:=x-0.00000000001;
if y>0 then y:=y+0.00000000001 else y:=y-0.00000000001;
[/pascal]
This was my mistake and when 3 numbers are the same like this.
Input

Code: Select all

1
0.5 0.5 0.5 0.5 0.5 0.5
Output

Code: Select all

There is no possible location.

Posted: Tue Sep 07, 2004 5:03 am
by Observer
Well, for the above case, my AC program doesn't give that output... But anyway, I wonder what the special checker is really for. It doesn't accepts -0.0, and it doesn't tolerate rounding errors of -0.05 etc... :-?

Posted: Sat Sep 11, 2004 7:40 am
by ..
Observer wrote:Well, for the above case, my AC program doesn't give that output... But anyway, I wonder what the special checker is really for. It doesn't accepts -0.0, and it doesn't tolerate rounding errors of -0.05 etc... :-?
Yes, I agree that.
A problem involving floating point isn't so easy to create,
it requires the problem setter to have much experience in setting problems.
(One of the "qualified" problem setter is Shahriar Manzoor, although his tricky input always make me tired of tracing......) I think the problem setter is not careful enoguh this time. It is not so good to require output with one digit after decimal point, as I remember, there is no other floating problem on the judge requires so few digits after decimal point. Because the precision error will become a big problem.........

all I/O tests passed successfully but still WA

Posted: Tue Oct 05, 2004 11:18 pm
by gullutc
Hi all. I checked my program with all your I/O sample, and every thing is all right...
Yet... I still get WA from the judge...

Could someone post more I/O? I just can't understand what is wrong...

Cheers
Flux

Posted: Sun Feb 27, 2005 12:44 am
by Destination Goa
The coordinates of each location is a pair of floating point numbers with the precision up to one-tenth.
How is this supposed to work with eps of 1e-14 for colinearity test?
What's about this case?

1
0.0000000000 0.0000000000
1.0000000000 0.0000000001
1.0000000000 -0.0000000001

Posted: Sun Feb 27, 2005 12:59 am
by Destination Goa
The coordinates of each location is a pair of floating point numbers with the precision up to one-tenth
How am I supposed to work with such definition? Actually each point becomes a square, so the answer will be infinity in most cases. Should I read it as "there is not more than 10 significant digits after decimal point, and points have their exact coordinates"?

Also, what is the limit for coordinates? 347856347856783458353647853465783645763478563478534534534.5 isn't easier to handle than just 123.000000001