Page 1 of 1

10353 - Circles in Hexagon :-)

Posted: Wed Sep 18, 2002 12:14 am
by Yarin
I suspect something fishy about this one, I got AC in the contest but not now. And nobody either it seems (at the moment of this writing).

Posted: Wed Sep 18, 2002 1:03 pm
by cyfra
Hi!

I got Accepted during the contest and now...

Maybe it depends on precision errors or something....

How are you counting the output ??

( my program just multiply the input by a constant :)

Posted: Wed Sep 18, 2002 2:39 pm
by Yarin
They must have corrected the error, but now I have AC without having resubmitted.

Posted: Wed Sep 18, 2002 3:30 pm
by dwyak
what's wrong? i didn't find.

Posted: Wed Sep 18, 2002 6:06 pm
by arc16
for the 1st output i multiply the input with 3.00 and the 2nd with 3.71. I think it's right, isn't it? If so, why do i get WA? :cry:

Posted: Wed Sep 18, 2002 7:27 pm
by Ivan Golubev
Is for input 0.00000001 the-most-closed-to-real answer equal to 0.000000030230 0.000000037493? Or I'm wrong?..

Posted: Wed Sep 18, 2002 9:02 pm
by Yarin
for the 1st output i multiply the input with 3.00 and the 2nd with 3.71. I think it's right, isn't it? If so, why do i get WA?
That's not very accurate. Your output must have like 9 significant digits, OR the answer must be at most 1e-9 off the correct answer (or something like that)
Is for input 0.00000001 the-most-closed-to-real answer equal to 0.000000030230 0.000000037493? Or I'm wrong?..
That's wrong. The first value seems to be under the assumption that the center of the five circles are a regular polygon with 5 edges, which is not true (but it's close...)

To Yarin

Posted: Wed Sep 18, 2002 10:48 pm
by Helal Md. Morshed Alam
hi
Yarin :D
That's wrong. The first value seems to be under the assumption that the center of the five circles are a regular polygon with 5 edges, which is not true (but it's close...)
Can you explain it...

Thanks.

Posted: Thu Sep 19, 2002 1:03 am
by Yarin
The first thing I did when I looked at the problem was assuming that the centre of the five circles was the corners of a regular polygon with 5 sides, but that gave the wrong answer. Thus the angle between the center of leftmost circle and the topleft circle cannot be exactly 54 degrees. By testing different angles, and doing some calculations on the topright circle, you can find for each angle how big the polygon must be. Once you get the formulas correct (some sin & cos & tan or something :) ), a binary search of the angle will work.

The problem with 7 circles is almost the same, the angle to the topleft circle is known (since it touches the upperleft edge of the hexagon) so the binary search is performed between the topleft and top circles). Almost the same calculations otherwise.

Why NOT Regular Pentagon??

Posted: Sat Sep 21, 2002 9:16 am
by Mahbub
I am not clear why the fact is false :

that they(centers) are on regular pentagon/heptagon..they ought to be to make the figures corrrect..or else the figure is incorrec!!

Whats the tricky point here?? i cant get it..can anybody help me??

Thanks.
--------
Mahbub

Posted: Sat Sep 21, 2002 10:47 am
by Ivan Golubev
Image
This image you've got if alpha == 54 degree (regular pentagon). So alpha must be slightly less than 54.

The same thing applies to case with eight circles.

tell me detail

Posted: Fri Nov 08, 2002 6:36 am
by minhaz
By testing different angles, and doing some calculations on the topright circle, you can find for each angle how big the polygon must be. Once you get the formulas correct (some sin & cos & tan or something ), a binary search of the angle will work.

:roll:

still i don't understand how i use bunary search and can any one give details of the formula to find relation why i have to multiply by 3 to get first output


bye
minhaz :oops:

Posted: Fri Jul 04, 2003 9:29 am
by Observer
------
EDIT

Finally got accepted. Thanks for all your hints, guys! :wink:

------
(Old msg. has been deleted.)