11277 - Cyclic Polygons

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

Moderator: Board moderators

Post Reply
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

11277 - Cyclic Polygons

Post by tobby »

I get WA. I try finding circumradius by bisection. I fear that it may not be so accurate for some cases, like very thin triangles. Can anyone give me some test cases? Thank you.
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

There are 2 cases:
The center of circle can lie inside the polygon or outside.
The bisection method is slightly different for these 2 cases.
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

Post by tobby »

I also take two cases as you said. What epsilons do you use?
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

I didn't use any epsilon
I just iterate the bisection 100 times.

Also, instead of bisection on radius r, I did bisection on 1/r, because r can range from xmax/2 to infinity.

r = infinity is the degenerate case, and output 0.000 there.
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

Post by tobby »

Thanks. I get accepted.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Use Newton's Method

Post by baodog »

I recommend Newton's method for this
problem.

Although bisection code will also run in time.
The combinatorial nature of the problem is to
realize you can re-order the edges to your advantage...
Think about how you can re-order the edges to make
your code significantly faster (amortized).
liuctic
New poster
Posts: 1
Joined: Tue Sep 11, 2007 9:03 am

The input data does not contain cases that...

Post by liuctic »

The input data does not contain cases that the center of the circle lies out of the polygon.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Added Dataset

Post by baodog »

I will add some datasets where the
center lies outside the polygon and
the problem will be rejudged.

What happened is the dataset was generated using
randomization. Somehow it didn't hit that
case as I had thought it surely would.
tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm

Post by tobby »

Don't add too much cases la, since many accepted solutions are close to time limit.. I think a couple of new cases is enough.
Post Reply

Return to “Volume 112 (11200-11299)”