시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 169 | 101 | 84 | 60.432% |
You are surrounded by Imperial warships and must land on a planet to escape. Your best chance is to find a route to the closest planet. Unfortunately the navigation system has been damaged. Your job is to write a program that will find the planet that is closest to your current location. Recall that the distance between two points (x1, y1) and (x2, y2) is given by the formula
dist = ( (x1 - x2)2 + (y1 - y2)2 )1/2
A positive integer, n, followed by n pairs of integers (x,y). Each pair will be on a separate line and there will be a space between x and y. The first pair will be the coordinates of your current location and all subsequent pairs will be the coordinates of the planets you can escape to.
Coordinates of your current location, coordinates of a closest planet, and the distance to that planet formatted to two decimal places. The distance must be accurate to two decimal places.
7 5 4 -80 9 100 89 67 -40 10 20 15 -5 34 0
5 4 15 -5 13.45