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 1956. Fire Signals

who can explain me this problem?
Posted by Mattiev Jamol 16 Jun 2013 11:12
I couldn't understand this problem perfectly.
Re: who can explain me this problem?
The problem is to draw a line on the plane such that sum of distances from all points in the input to this line is minimum. And you should output this minimum number - that's all
Re: who can explain me this problem?
Posted by Mattiev Jamol 16 Jun 2013 16:32
do you explain for this test  and add one test to be understandable please?
why the answer is 1.414214


Edited by author 16.06.2013 16:34
Re: who can explain me this problem?
I'm sorry, but my explanation should be more than clear. If you don't understand - study math harder (or maybe English)
Re: who can explain me this problem?
Posted by Sandro (USU) 17 Jun 2013 12:01
In the example from the problem statement you should draw a line x - y = 0.
So, the distance from (0, 0) is 0, from (0, 1) is sqrt(2)/2, from (1, 1) is 0, from (1, 0) is sqrt(2)/2. The sum of all distances is sqrt(2).
Re: who can explain me this problem?
Posted by Mattiev Jamol 18 Jun 2013 11:15
I understood. thanks alot! what is the best alghoritm to solve this problem

Edited by author 18.06.2013 11:58