小Susie,由于她的哥哥喜欢玩汽车。今天她决定在他们之间设立一个锦标赛。锦标赛的过程将在下一段中描述。
有n个玩具车。每一对都会发生碰撞。碰撞的结果可以是以下之一:没有车翻车,一辆车翻车,两辆车都翻车。如果一辆车没有过翻车,那么它就是好的。碰撞的结果由一个n×n矩阵A决定:在第i行和第j列的交点上有一个数字,描述第i辆车和第j辆车碰撞的结果。
-1:如果这对汽车从未碰撞过。-1只出现在矩阵的主对角线上。
0:如果在碰撞过程中没有车翻身。
1:如果在碰撞中只有第i辆车翻车。
2:如果在碰撞中只有第j辆汽车翻车。
3:如果在碰撞过程中两辆车都翻车了。
Susie想找到所有的好车。她很快就确定了哪些车是好车。你能应付这个任务吗?
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are
n toy cars. Each pair collides. The result of a collision can be one of the following: no car turned over, one car turned over, both cars turned over. A car is good if it turned over in no collision. The results of the collisions are determined by an
n×n matrix
A: there is a number on the intersection of the
i-th row and
j-th column that describes the result of the collision of the
i-th and the
j-th car:
-
-1: if this pair of cars never collided. -1 occurs only on the main diagonal of the matrix.
-
0: if no car turned over during the collision.
-
1: if only the i-th car turned over during the collision.
-
2: if only the j-th car turned over during the collision.
-
3: if both cars turned over during the collision.
Susie wants to find all the good cars. She quickly determined which cars are good. Can you cope with the task?