A fence and four boulders

Back to Topic List

aszaloki     2024-10-24 14:22:32

Hi Kevin!

I have a solution for the problem, although the checker does not accept them. After my calculations I checked the difference between the result radius and the distance between a point and circle center for each given points. So if my results are: R - is the radius of the circle centerX - is the X coordinate of the center centerY - is the Y coordinate of the center

then my checking for each given points (xi, yi)

di := distance((xi, y_i), (centerX, centerY))

abs(d_i - R) is the same for each given input points

This time I strongly believe that my solution is correct :)

Could you please check the checker?

Thanks!

admin (Kevin)     2024-10-28 13:56:36
User avatar

Hi Adam!

The error was indeed on my end, this time accidentally leaving a key piece out of the prompt... the final circle should leave 2 of the boulders outside the fence and 2 inside. Your code indeed was correctly providing a circle which inlcuded 3 boulders on one side - maybe I'll make a follow up problem for that method too!

Sorry about that!!!

aszaloki     2024-10-28 14:07:34

Hi Kevin!

Ah, OK, now I see. No Problem! So 2 inside and 2 outside... I think my method needs only a slight modification. Thank you for clarification!

aszaloki     2024-10-28 15:09:21

Yippie!! Solution accepted :)

Please login and solve 5 problems to be able to post at forum