你们有 n 计算机被从 1 总计到 n 和你想要连接他们制造一个小当地的区域网络 (区域网络).所有连接是双行道的.(哪一正在连接计算机 i 和 j 相同于连接计算机 j 和 i)连接计算机 i 和计算机 j 的费用是 cij .你由于一些特别的理由不能够连接计算机的一些双.你想要连接他们,以便每部计算机直接地或者间接地连接至任何其他的,而且你也想要尽可能少支付.
给予的 n 和每 cij ,找最廉宜的方法连接计算机.
输入
有多个测试情形.输入的第一条线包含一个完整的事物 T(T <=100),指出测试情形的数字.然后 T 测试情形而起.
每个测试情形的第一条线包含一个完整的事物 n .(1< n <=100)然后 n 排成一行追从,每个哪一个包含因空间而分开的 n 完整的事物.i-th 的 j-th 完整的事物排成一行在这些 n 线是 cij,指出连接计算机 i 和 j 的费用.(cij = 0个方法你不能够连接他们)0
英语翻译不要用机器在线等
英语翻译不要用机器在线等
You have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that is connecting computers i and j is the same as connecting computers j and i). The cost of connecting computer i and computer j is cij. You cannot connect some pairs of computers due to some particular reasons. You want to connect them so that every computer connects to any other one directly or indirectly and you also want to pay as little as possible.
Given n and each cij , find the cheapest way to connect computers.
Input
There are multiple test cases. The first line of input contains an integer T (T
You have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that is connecting computers i and j is the same as connecting computers j and i). The cost of connecting computer i and computer j is cij. You cannot connect some pairs of computers due to some particular reasons. You want to connect them so that every computer connects to any other one directly or indirectly and you also want to pay as little as possible.
Given n and each cij , find the cheapest way to connect computers.
Input
There are multiple test cases. The first line of input contains an integer T (T
英语人气:437 ℃时间:2019-08-26 07:58:45
优质解答
我来回答
类似推荐
猜你喜欢
- 1唐代诗人李白和杜甫的关系
- 2标点符号 作文
- 3已知a,b是一元二次方程2x²+4x+1=0的两个实数根,求代数式√(a/b)+√(b/a)的值
- 4根据图中的五个汉字的方位,猜出三条成语
- 5一类自然数,它们的各个数位上的数字和为2004,那么这类自然数中最小的一个是_.(可以使用省略号)
- 6一张地图的比例尺是1:2000,若实际距离是100米,那么地图上距离为?厘米
- 7师徒二人同时加工一批零件师傅每天甲共30个徒弟每天加工20个加工350个机器零件共许多少天
- 8常用室内照明电压220V是指交流的什么值?A最大值 B瞬间值 C平均值 D有效值
- 9有1元、2元、5元、10元的人民币个1张.每次取2张,可以组成( )种不同的币值. A.14 B.10 C.6 D.4
- 10如图,点C、D在线段AB上,△PCD是等边三角形. (1)当AC、CD、DB满足怎样的关系时,△ACP∽△PDB; (2)当△ACP∽△PDB时,求∠APB的度数.