10697 - Firemen barracks

All about problems in Volume 106. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

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

Post 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.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

Real Type.

Post by _.B._ »

Greetings!
Real Type for everything.
Did you check the I/O in previos post?

Keep posting!
_.
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post 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.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

I\O.

Post 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!
_.
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post 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._
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

Post 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.
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post 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.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

Post 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.
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

Good!

Post 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!
_.
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

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

Post 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... :-?
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post 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.........
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
gullutc
New poster
Posts: 3
Joined: Wed Dec 10, 2003 12:02 pm

all I/O tests passed successfully but still WA

Post 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
Destination Goa
Experienced poster
Posts: 123
Joined: Thu Feb 10, 2005 4:46 am

Post 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
To be the best you must become the best!
Destination Goa
Experienced poster
Posts: 123
Joined: Thu Feb 10, 2005 4:46 am

Post 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
To be the best you must become the best!
Post Reply

Return to “Volume 106 (10600-10699)”