编程介的小学生 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程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置