来自codeforces You invited nn guests to dinner! You plan to arrange one or more circles of chairs. Each chair is going to be either occupied by one guest, or be empty. You can make any number of circl
一、题目 给定一个二维的 0-1 矩阵,如果第 (i, j) 位置是 1,则表示第 i 个人和第 j 个人是朋友。已知朋友关系是可以传递的,即如果 a 是 b 的朋友,b 是 c 的朋友,那么 a 和 c 也是朋友,换言之这三个人处于同一个朋友圈之内。求一共有多少个朋友圈。 输入输出样例输入是一个二维数组,输出是一个整数,表示朋友圈数量。因为朋友关系具有对称性,该二维数组为对称矩阵。同时,因为
题目 There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct friend of C
If you’ve seen television commercials for long-distance phone companies lately, you’ve noticed that many companies have been spending a lot of money trying to convince people that they provide the