Logo
(追記) (追記ここまで)

4077번 - Reliable Nets 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB52181741.463%

문제

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.

제한

예제 입력 1

4 5
1 2 1
1 3 2
2 4 2
3 4 1
2 3 1
2 1
1 2 5
0 0

예제 출력 1

The minimal cost for test case 1 is 6.
There is no reliable net possible for test case 2.

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2005 East Central Regional Contest E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /