你們有 n 計(jì)算機(jī)被從 1 總計(jì)到 n 和你想要連接他們制造一個(gè)小當(dāng)?shù)氐膮^(qū)域網(wǎng)絡(luò) (區(qū)域網(wǎng)絡(luò)).所有連接是雙行道的.(哪一正在連接計(jì)算機(jī) i 和 j 相同于連接計(jì)算機(jī) j 和 i)連接計(jì)算機(jī) i 和計(jì)算機(jī) j 的費(fèi)用是 cij .你由于一些特別的理由不能夠連接計(jì)算機(jī)的一些雙.你想要連接他們,以便每部計(jì)算機(jī)直接地或者間接地連接至任何其他的,而且你也想要盡可能少支付.
給予的 n 和每 cij ,找最廉宜的方法連接計(jì)算機(jī).
輸入
有多個(gè)測(cè)試情形.輸入的第一條線包含一個(gè)完整的事物 T(T <=100),指出測(cè)試情形的數(shù)字.然后 T 測(cè)試情形而起.
每個(gè)測(cè)試情形的第一條線包含一個(gè)完整的事物 n .(1< n <=100)然后 n 排成一行追從,每個(gè)哪一個(gè)包含因空間而分開的 n 完整的事物.i-th 的 j-th 完整的事物排成一行在這些 n 線是 cij,指出連接計(jì)算機(jī) i 和 j 的費(fèi)用.(cij = 0個(gè)方法你不能夠連接他們)0
英語翻譯不要用機(jī)器在線等
英語翻譯不要用機(jī)器在線等
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
英語人氣:172 ℃時(shí)間:2019-08-26 07:58:45
優(yōu)質(zhì)解答
我來回答
類似推薦
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 用一個(gè)詞概括下面的短語 1 淚水奪眶而出() 2喜眉笑目( ) 3 涌出了淚水()
- 已知2<x<3,化簡丨x-2丨+丨x-3丨=
- 如果點(diǎn)A表示數(shù)-3,將A向右移動(dòng)6個(gè)單位長度,在向左移動(dòng)4個(gè)單位長度,那么終點(diǎn)表示的數(shù)是----------
- 小明和小亮想買同一本書,小明缺1元5角,小亮缺1元3角.如果用他們的錢合買這本書,錢正好.這本書的價(jià)錢是多少?
- PLANT A CROP OF PUMPKINS是什么意思
- 在673k,1.01*10^5pa時(shí),有1mol氣體A發(fā)生反應(yīng)2A=xB+C(g).在一定條件下已經(jīng)達(dá)到平衡.在平衡混合氣體中,
- 從《羚羊木雕》能讀出作者什么樣的感情傾向?
猜你喜歡
- 1在一只長25cm,寬20cm,高1dm的長方體玻璃缸中盛滿水.如果將這些水倒入一個(gè)棱長為2dm的正方體容器內(nèi),水的高度是多少?(兩個(gè)容器的壁厚忽略不計(jì))
- 2x/(1+x^2)^(-1/2)展開成x的冪級(jí)數(shù),
- 3疏影橫斜水清淺 暗香浮動(dòng)月黃昏
- 4There is a lot of to see at the party.There is a lot to see at the party.聚會(huì)上有許多可觀賞的東西
- 5收音機(jī)上的AM和FM分別代表什么意思?
- 6已知關(guān)于x的一元二次方程x2+(m+3)x+m+1=0
- 7函數(shù)y=x²-4x+6在X∈[1,5)的值域是
- 8《威尼斯的小艇》運(yùn)用的寫作方法是什么
- 9小明 小軍 小亮三人接力賽跑 小明跑了全程的四分之一 小軍跑了50米 小亮接著跑完了全程的幾分之幾
- 10設(shè)三角形ABC的三內(nèi)角ABC所對(duì)邊的邊長分別為a,b,c,平面向量m=(cosA,cosC),向量n=(c,a),向量p=(2b,0)……
- 11she is a good student.改為復(fù)數(shù)形式怎么改
- 12已知a>0,b>0,則a+b=2是ab≦1的什么條件