시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 11 | 3 | 3 | 50.000% |
A spy agency wants to monitor all communications in a computer network. They have a budget for at most 10 installations of spying software on 10 of the host computers on the network. For the software to work properly each communication line A–B must have at least one host A or B being monitored.
Input will consist of a number of network scenarios. Each scenario will contain:
The last line of input will be a ‘0’ on a line by itself. This line should not be processed.
Output will consist of one line for each input network, indicating whether the network can be successfully spied upon by infecting 10 nodes. Each line of the output will consist of ‘Network n: ’, where n is the scenario number, starting at 1, followed by ‘yes’ or ‘no’.
11 5 1 3 5 8 10 5 0 2 4 6 9 5 1 3 5 6 10 4 0 2 4 6 4 1 3 5 7 5 0 2 4 6 8 6 1 2 3 5 7 9 4 4 6 8 10 4 0 5 7 9 4 1 6 8 10 4 0 2 7 9 11 10 1 2 3 4 5 6 7 8 9 10 10 0 2 3 4 5 6 7 8 9 10 10 0 1 3 4 5 6 7 8 9 10 10 0 1 2 4 5 6 7 8 9 10 10 0 1 2 3 5 6 7 8 9 10 10 0 1 2 3 4 6 7 8 9 10 10 0 1 2 3 4 5 7 8 9 10 10 0 1 2 3 4 5 6 8 9 10 10 0 1 2 3 4 5 6 7 9 10 10 0 1 2 3 4 5 6 7 8 10 10 0 1 2 3 4 5 6 7 8 9 12 11 1 2 3 4 5 6 7 8 9 10 11 11 0 2 3 4 5 6 7 8 9 10 11 11 0 1 3 4 5 6 7 8 9 10 11 11 0 1 2 4 5 6 7 8 9 10 11 11 0 1 2 3 5 6 7 8 9 10 11 11 0 1 2 3 4 6 7 8 9 10 11 11 0 1 2 3 4 5 7 8 9 10 11 11 0 1 2 3 4 5 6 8 9 10 11 11 0 1 2 3 4 5 6 7 9 10 11 11 0 1 2 3 4 5 6 7 8 10 11 11 0 1 2 3 4 5 6 7 8 9 11 11 0 1 2 3 4 5 6 7 8 9 10 0
Network 1: yes Network 2: yes Network 3: no