|
|
вернуться в форумI couldn't understand this problem perfectly. 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 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 I'm sorry, but my explanation should be more than clear. If you don't understand - study math harder (or maybe English) 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). I understood. thanks alot! what is the best alghoritm to solve this problem Edited by author 18.06.2013 11:58 |
|
|