#P1523. 旅行商简化版
旅行商简化版
Description
This problem is a simplified version of the famous NP-complete problem.
There are points on the Cartesian plane. Each point has coordinates , where and both are integers. The cost to travel between any two points is the Euclidean distance between them. Your task is to compute the shortest bitonic tour.
Input Format
The first line contains an integer .
Each of the next lines contains two integers , representing the coordinates of a point.
It is guaranteed that there are no duplicate points, and that both the westernmost point and the easternmost point are unique.
Output Format
Output one line: the length of the shortest tour, with decimal places.
7
0 6
1 0
2 3
5 4
6 1
7 5
8 2
25.58
Hint
Source: Introduction to Algorithms (Second Edition), 15-1.
Translated by ChatGPT 5
京公网安备 11011102002149号