标签:
nocow上的题解很好。 http://www.nocow.cn/index.php/USACO/schlnet
如何求强连通分量呢?对于此题,可以直接先用floyd,然后再判断。
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the "receiving schools"). Note that if B is in the distribution list of school A, then A does not necessarily appear in the list of school B.
You are to write a program that computes the minimal number of schools that must receive a copy of the new software in order for the software to reach all schools in the network according to the agreement (Subtask A). As a further task, we want to ensure that by sending the copy of new software to an arbitrary school, this software will reach all schools in the network. To achieve this goal we may have to extend the lists of receivers by new members. Compute the minimal number of extensions that have to be made so that whatever school we send the new software to, it will reach all other schools (Subtask B). One extension means introducing one new member into the list of receivers of one school.
5 2 4 3 0 4 5 0 0 0 1 0
Your program should write two lines to the output file. The first line should contain one positive integer: the solution of subtask A. The second line should contain the solution of subtask B.
1 2
[IOI1996] USACO Section 5.3 Network of Schools(强连通分量)
标签:
原文地址:http://www.cnblogs.com/JSZX11556/p/4345619.html