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 1332. Genie Bomber

WA10 help
Posted by Giorgi Saghinadze (Tbilisi SU) 28 Feb 2007 21:57
I have WA 10.
I think I can't find coordinates center of circle very well. I think I have presision error. because in my solution I use numbers which maybe become larger than maxlongint;

if we have points. x1,y1 and x2,y2 and they are located at circle. how we can find coordinates cenrte of circle ?

sorry for my bad English
Re: WA10 help
Posted by Kit 1 Mar 2007 00:09
There are great number of ways to define circle by two points on it. One of these: (x1 + x2)/2, (y1 + y2)/2, isn't it :)
Re: WA10 help
Posted by Giorgi Saghinadze (Tbilisi SU) 1 Mar 2007 00:40
Kit wrote 1 March 2007 00:09
One of these: (x1 + x2)/2, (y1 + y2)/2, isn't it :)
yes of course. but I missed one thing. radius should be fixed.
we have points at circle x1,y1,x2,y2 and r. find the centre point of cirle which radius is r. :)
 how can I do it?
Re: WA10 help
Posted by Kit 1 Mar 2007 01:43
For example, you can consider isosceles triangle (two original points and center). You can also solve two equations: dist(p, p1) = r and dist(p, p2) = r in coordinats (but I think first way is simpler).