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 1215. Exactness of Projectile Hit

Danica Porobic Can someone give me some tests? [8] // Problem 1215. Exactness of Projectile Hit 20 Aug 2004 02:49
I got WA #4, but I think I got all special cases ok, so help please.
LeXuS[Alex Kalugin] Re: Can someone give me some tests? [5] // Problem 1215. Exactness of Projectile Hit 20 Aug 2004 04:30
I think all problem is in looking, where the center of projectile is situated(outside or inside)...
Gheorghe Stefan Re: Can someone give me some tests? // Problem 1215. Exactness of Projectile Hit 20 Aug 2004 04:51
I tryied to find the diameter with binary search and at each step we verify if it crosses the polygon.
Danica Porobic Re: Can someone give me some tests? [3] // Problem 1215. Exactness of Projectile Hit 20 Aug 2004 17:14
I used different approach, first I calculate if the center is inside, using dummy point ( point that is inside ), and then I calculate minimum distance to the from then center to the polygon, my code:

[code deleted]

Edited by moderator 13.02.2007 20:51
Gheorghe Stefan Re: Can someone give me some tests? // Problem 1215. Exactness of Projectile Hit 21 Aug 2004 16:12
Here is a test for you:
-1000000 1000000 4
0 -1000
600 0
0 1000
-1000 0

mine says: 2827012.911
yours: 2827013.265

little diference but...
You can implement the binary search, it's easy... And then compare it with your solution to find the bug...
I have the same solution and it gives the same answer to the offered test. It is mathematically proved that the algo is correct.
Thus, the difference from right answer appears only because of computer limitations. It means we should try to guess the author's solution (according to which the tests were created) and throw away all other correct ones (this, for example).
It's completely unfair.
Olecksandr[Lviv NU] some tests for you // Problem 1215. Exactness of Projectile Hit 8 Feb 2007 05:08
3 0 8
0 2
2 0
4 0
6 2
6 4
4 6
2 6
0 4

[0.000]

0 0 8
0 2
2 0
4 0
6 2
6 4
4 6
2 6
0 4

[2.828]

0 0 4
1 1
-1 1
-1 -1
1 -1

[0.000]

-1000000 -1000000 3
999999 1000000
1000000 999999
1000000 1000000

[5656852.835]

2 0 3
4 0
3 3
0 3

[2.400]
Jabarov_Roman Re: Can someone give me some tests? [1] // Problem 1215. Exactness of Projectile Hit 30 Sep 2007 18:51
try this test....
0 0 3
1 0
3 0
2 3
-> 2.000
[RISE] Binary Mind [RAU] Re: Can someone give me some tests? // Problem 1215. Exactness of Projectile Hit 8 Jul 2014 06:09
Why do you write such tests? Coordinates must be in range [-2000, 2000]

Edited by author 08.07.2014 06:09