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

Show all messages Hide all messages

Can you give me a hint on how to solve this? Hao Hu (Ikki @ Nanjing University) 29 Dec 2006 12:17
as the title
thanks in advance!
Re: Can you give me a hint on how to solve this? EfremovAleksei 29 Dec 2006 15:02
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
Re: Can you give me a hint on how to solve this? Slam [Tartu U] 29 Dec 2006 19:05
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.
Re: Can you give me a hint on how to solve this? EfremovAleksei 30 Dec 2006 15:34
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.


Timus-1504 does not require voronoi graph either ;) (-) Dmitry 'Diman_YES' Kovalioff 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
Saddam's coordinates are not necessarily integer (+) Dmitry 'Diman_YES' Kovalioff 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 ;)
I need an AC solution to this problem 323232 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
Check your mail. I have sent you an exe-file of my solution (-) Dmitry 'Diman_YES' Kovalioff 11 Jan 2007 16:07
Probability will rule? SPIRiT 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
Re: Probability will rule? Vedernikoff Sergey 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.
Re: Probability will rule? SPIRiT 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?
Re: Probability will rule? Vedernikoff Sergey 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...
Re: Probability will rule? SPIRiT 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 :)
Re: Probability will rule? Vedernikoff Sergey 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...
Re: Probability will rule? nttjuvwamsncc 14 Feb 2007 14:35
I don't understand you solution
tell me more
Re: Probability will rule? KIRILL(ArcSTU) 19 Jan 2007 14:46
Vedernikoff Sergey 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
Re: Probability will rule? Vedernikoff Sergey 22 Jan 2007 14:55
Apply some optimixation techniques - precalc, for instance...
Re: Probability will rule? KIRILL(ArcSTU) 22 Jan 2007 19:13
Vedernikoff Sergey 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
Re: Probability will rule? it4.kp 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.
Re: Probability will rule? nttjuvwamsncc 14 Feb 2007 14:33
can you tell me more about your solution
Re: Can you give me a hint on how to solve this? nttjuvwamsncc 14 Feb 2007 14:33
how can you solve this problem without the diagram
Where can I read about diagram of Voronoy?
Re: Can you give me a hint on how to solve this? EfremovAleksei 29 Dec 2006 23:05
Preparata, Shajmos. Computational geometry. An introdution.
theriyaathutaa koothi