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 1520. Empire Strikes Back

Hao Hu (Ikki @ Nanjing University) Can you give me a hint on how to solve this? [30] // Problem 1520. Empire Strikes Back 29 Dec 2006 12:17
as the title
thanks in advance!
Diagram of Voronoy, of course.
Well well, the second problem on Timus that should be solved with diagram of Voronoy
Well well, the second problem on Timus that should be solved with diagram of Voronoy
What one was first?
1504
This problem can be easily solved WITHOUT Voronoi's diagram.
I didn't write 1504 yet, but it also doesn't require such complicated methods.
I got AC used diagram of voronoi.
Kit, please send me your program - efrcom@inbox.ru

It's very interesting for me, how solved it without voronoi's diagram.


Dmitry 'Diman_YES' Kovalioff. Retired Timus-1504 does not require voronoi graph either ;) (-) [4] // Problem 1520. Empire Strikes Back 30 Dec 2006 19:25
I was not talking about 1504. I was talking about 1369 - the Cockroaches problem. Originally it was possible to solve the task with quadtree. But after new tests added to the task quadtree does not work. Therefore a more sophisticated structure is required.
It's not clear. The plants are guaranteed to have integer coordinates. Is that true for Saddam too? If so, it's might be a simple binary search
No, it is said that Sassam is somewhere in the circle - not required to be at an integer coordinate. (in fact he is somewhere else but... that's the problem statement - not up to date).
-- it would be good to post such question in other topics for the future
Dmitry 'Diman_YES' Kovalioff. Retired Saddam's coordinates are not necessarily integer (+) // Problem 1520. Empire Strikes Back 5 Jan 2007 20:57
He might be anywhere within the circle.

P.S. It is a pity Saddam III has been hang alone. I wonder when George II will follow him ;)
323232 I need an AC solution to this problem [13] // Problem 1520. Empire Strikes Back 11 Jan 2007 15:58
To Kit:
I thought it can be solved without Voronoi's diagram, too. But I got Wrong Answer here. Could you send your solution to gaoyihan@gmail.com? I want to check my program. you can only give me the exe-file.

Edited by author 11.01.2007 16:24
Dmitry 'Diman_YES' Kovalioff. Retired Check your mail. I have sent you an exe-file of my solution (-) // Problem 1520. Empire Strikes Back 11 Jan 2007 16:07
SPIRiT Probability will rule? [11] // Problem 1520. Empire Strikes Back 11 Jan 2007 18:16
I think it's binary search + Monte-Carlo. Is such approach correct?

Edited by author 11.01.2007 18:16
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) Re: Probability will rule? [10] // Problem 1520. Empire Strikes Back 16 Jan 2007 15:15
Why Monte-Carlo? I think, you'll get WA, because answer should be very accurate. Use binary search and bruteforce - O(N^3*logN), AC in ~ 0.25 secs.
SPIRiT Re: Probability will rule? [8] // Problem 1520. Empire Strikes Back 17 Jan 2007 19:01
I think it's like this. The problem is how to define if for the given radius r the original circle is completely covered? (I don't think that there is a straight formula for 300 points). Therefore I just generate 50 points randomly and for each check does it belong to one of the inner circles or not. If there is a point that does not belong to any of the inner circle, the radius is not big enough, otherwise it's big enough. The binary search is obvious. How do you check the coverage with bruteforce? Any hint or algo?
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) Re: Probability will rule? [7] // Problem 1520. Empire Strikes Back 18 Jan 2007 16:46
If you drop only 50 points, you'll not detect many little "white spaces" (when, for example, current radius 1e-3 less, than optimal. Obviously, such a solution will get WA.
How to check coverage with bruteforce? Intersect any two circles and consider epsilon neighborhood of their common points...
SPIRiT Re: Probability will rule? [2] // Problem 1520. Empire Strikes Back 18 Jan 2007 17:21
Thanks a lot. But perhaps if I increase the number of random points (for each check a separate set of points), I'll get AC (if not from the first time, than from the second thanks to the random :)
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) Re: Probability will rule? // Problem 1520. Empire Strikes Back 19 Jan 2007 14:30
To my mind, it's practically impossible. You should check (1000/1e-5)^2 ~ 10^16 points on every step of binsearch to catch "little whitespaces". Quadrotrees can help you a little, but...
nttjuvwamsncc Re: Probability will rule? // Problem 1520. Empire Strikes Back 14 Feb 2007 14:35
I don't understand you solution
tell me more
KirillB(Arkhangelsk - PomorSU) Re: Probability will rule? [3] // Problem 1520. Empire Strikes Back 19 Jan 2007 14:46
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) wrote 18 January 2007 16:46
If you drop only 50 points, you'll not detect many little "white spaces" (when, for example, current radius 1e-3 less, than optimal. Obviously, such a solution will get WA.
How to check coverage with bruteforce? Intersect any two circles and consider epsilon neighborhood of their common points...

Your idea is very good, but how you did it so fast?
I have TL16
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) Re: Probability will rule? [2] // Problem 1520. Empire Strikes Back 22 Jan 2007 14:55
Apply some optimixation techniques - precalc, for instance...
KirillB(Arkhangelsk - PomorSU) Re: Probability will rule? [1] // Problem 1520. Empire Strikes Back 22 Jan 2007 19:13
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) wrote 22 January 2007 14:55
Apply some optimixation techniques - precalc, for instance...

Now I have WA17
I do not understand what points should we check
If we will check only neighboor points of
intersection any 2 circles - it's not right

For example
2 1000
1000 0
999 0

Right answer is 1999

But if we will check radius 1000 then both intersection points will lie out of main circle
it4.kp Re: Probability will rule? // Problem 1520. Empire Strikes Back 22 Jan 2007 22:25
For each two crossing circles (crossing inside main circle) there must be third one which covers intersection point of the first two circles.
nttjuvwamsncc Re: Probability will rule? // Problem 1520. Empire Strikes Back 14 Feb 2007 14:33
can you tell me more about your solution
how can you solve this problem without the diagram
Where can I read about diagram of Voronoy?
Preparata, Shajmos. Computational geometry. An introdution.
theriyaathutaa koothi