编程介的小学生 2017-10-25 14:47 采纳率: 20.5%
浏览 927
已采纳

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�1�72 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.
输出:

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.
样例输入:

2
5
0 0
1 0
18 0
0 1
1 1
3
0 0
1 0
0 1
样例输出:

3.00
1.00

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-11-09 07:43
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用C语言输入方程怎么
  • ¥15 github训练的模型参数无法下载
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志