当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3771:World Islands

题目描述
Dubai is a haven for the rich. The government of Dubai finds a good way to make money. They built a lot of artificial islands on the sea and sell them. These islands are shaped into the continents of the world, so they are called “world islands”. All islands are booked out now. The billionaires who buy these islands wants to make friends with each other, so they want these islands all be connected by bridges. Bill Gates also has booked an island, but he is the only one who doesn’t want his island to be connected with other islands, because he prefer to travel on the sea on his old landing craft which is used in the Invasion of Normandy in World War II. Fortunately, Bill doesn’t care about which island is saved for him, so Dubai government can still find the best way to build the bridges. The best way means that the total length of the bridges is minimum. In a word, if there are n islands, what they should do is to build n–2 bridges connecting n-1 islands, and give the rest island to Bill Gates. They can give any island to Bill Gates. Now they pay you good money to help them to find out the best way to build the bridges.

Please note:

  1. An island can be considered as a point.

  2. A bridge can be considered as a line segment connecting two islands.

  3. A bridge connects with other bridges only at the islands.


输入解释
The first line is an integer indicating the number of test cases.
For each test case, the first line is an integer n representing the number of islands.(0 < n < 50)
Then n lines follow. Each line contains two integers x and y( -20 <= x, y <= 20 ) , indicating the coordinate of an island.
输出解释
For each test case, output the minimum total length of the bridges in a line. The results should be rounded to 2 digits after decimal point, and you must keep 2 digits after the decimal point.
输入样例
2
5
0 0
1 0
18 0
0 1
1 1
3
0 0
1 0
0 1
输出样例
3.00
1.00

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3771

最后修改于 2020-10-29T07:11:01+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536