文件名称:BestWriting
-
所属分类:
- 标签属性:
- 上传时间:2015-05-10
-
文件大小:1.27kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
★实验任务
学校有 n 台计算机,为了方便数据传输,现要将它们用数据线连接起来。两台计
算机被连接是指它们之间有数据线连接。由于计算机所处的位置不同,因此不同的两台计算
机的连接费用往往是不同的。
当然,如果将任意两台计算机都用数据线连接,费用将是相当庞大的。为了节省费用,
我们采用数据的间接传输手段,即一台计算机可以间接的通过若干台计算机(作为中转)来
实现与另一台计算机的连接。
现在由你负责连接这些计算机,你的任务是花费最小代价使任意两台计算机都连通(不
管是直接的或间接的),最后你还要说明方案是否唯一。
★数据输入
第一行,一个整数 t,代表有几个测试例。
接下来一行,两个整数 n,m(1<=n<=100,0<=m<=10000)。
接下来 m 行,每行有三个整数 x,y,w,表示连接 x 和 y 这两台计算机需要的费用是
w。(1<=x,y<=n,1<=w<=1000000)
数据保证图是连通的。
★数据输出
对于每个测试例,输出两行:
第一行,输出使任意两台计算机都连通的最小代价。
第二行,如果方案是唯一的,输出 Unique! 否则输出 Not Unique-The school has n computer, in order to facilitate data transmission, we will connect them with data line. Two meter
The computer is connected to the data line refers to the connection between them. Due to the different location of the computer, so the calculation of different two
The cost of connection machine is often different.
Of course, if any two computers are connected with the data line, the cost will be enormous. In order to save costs,
We use indirect means of data transmission, namely a computer can indirectly through several computers (as a transit).
Connect with another computer.
You are now responsible for connecting the computer, your task is to take the minimum cost so that any two computers are not connected (
The tube is directly or indirectly), finally you have to explain whether the plan only.
学校有 n 台计算机,为了方便数据传输,现要将它们用数据线连接起来。两台计
算机被连接是指它们之间有数据线连接。由于计算机所处的位置不同,因此不同的两台计算
机的连接费用往往是不同的。
当然,如果将任意两台计算机都用数据线连接,费用将是相当庞大的。为了节省费用,
我们采用数据的间接传输手段,即一台计算机可以间接的通过若干台计算机(作为中转)来
实现与另一台计算机的连接。
现在由你负责连接这些计算机,你的任务是花费最小代价使任意两台计算机都连通(不
管是直接的或间接的),最后你还要说明方案是否唯一。
★数据输入
第一行,一个整数 t,代表有几个测试例。
接下来一行,两个整数 n,m(1<=n<=100,0<=m<=10000)。
接下来 m 行,每行有三个整数 x,y,w,表示连接 x 和 y 这两台计算机需要的费用是
w。(1<=x,y<=n,1<=w<=1000000)
数据保证图是连通的。
★数据输出
对于每个测试例,输出两行:
第一行,输出使任意两台计算机都连通的最小代价。
第二行,如果方案是唯一的,输出 Unique! 否则输出 Not Unique-The school has n computer, in order to facilitate data transmission, we will connect them with data line. Two meter
The computer is connected to the data line refers to the connection between them. Due to the different location of the computer, so the calculation of different two
The cost of connection machine is often different.
Of course, if any two computers are connected with the data line, the cost will be enormous. In order to save costs,
We use indirect means of data transmission, namely a computer can indirectly through several computers (as a transit).
Connect with another computer.
You are now responsible for connecting the computer, your task is to take the minimum cost so that any two computers are not connected (
The tube is directly or indirectly), finally you have to explain whether the plan only.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
BestWriting.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.