当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2735:Reliable Nets

题目描述
You're in charge of designing a campus network between buildings and are very worried about its reliability and its cost. So, you've decided to build some redundancy into your network while keeping it as inexpensive as possible. Specifically, you want to build the cheapest network so that if any one line is broken, all buildings can still communicate. We'll call this a minimal reliable net.
输入解释
There will be multiple test cases for this problem. Each test case will start with a pair of integers n (<= 15) and m (<= 20) on a line indicating the number of buildings (numbered 1 through n) and the number of potential inter-building connections, respectively. (Values of n = m = 0 indicate the end of the problem.) The following m lines are of the form b1 b2 c (all positive integers) indicating that it costs c to connect building b1 and b2. All connections are bidirectional.
输出解释
For each test case you should print one line giving the cost of a minimal reliable net. If there is a minimal reliable net, the output line should be of the form:
The minimal cost for test case p is c.
where p is the number of the test case (starting at 1) and c is the cost. If there is no reliable net possible, output a line of the form:
There is no reliable net possible for test case p.
输入样例
4 5
1 2 1
1 3 2
2 4 2
3 4 1
2 3 1
2 1
1 2 5
0 0
输出样例
The minimal cost for test case 1 is 6.
There is no reliable net possible for test case 2.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2735

最后修改于 2020-10-29T06:41:02+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536