5222: 玩具汽车

内存限制:256 MB 时间限制:2 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:42 通过:1

题目描述

小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?
Input
The first line contains integer n (1≤n≤100) − the number of cars.
Each of the next n lines contains n space-separated integers that determine matrix A.
It is guaranteed that on the main diagonal there are -1, and -1 doesn't appear anywhere else in the matrix.
It is guaranteed that the input is correct, that is, if Aij=1, then Aji=2, if Aij=3, then Aji=3, and if Aij=0, then Aji=0.
Output
Print the number of good cars and in the next line print their space-separated indices in the increasing order.
Examples
Input
3
-1 0 0
0 -1 1
0 2 -1
Output
2
1 3 
Input
4
-1 3 3 3
3 -1 3 3
3 3 -1 3
3 3 3 -1
Output
0

输入格式

第一行包含整数n(1≤n≤100)--汽车的数量。
接下来的n行包含n个隔开空间的整数,确定矩阵A。
保证在主对角线上有-1,而且-1不会出现在矩阵的其他地方。
保证输入是正确的,也就是说,如果Aij=1,那么Aji=2,如果Aij=3,那么Aji=3,如果Aij=0,那么Aji=0。

输出格式

打印好车的数量,并在下一行按递增的顺序打印它们以空格分隔的序号。

输入样例 复制

3
-1 0 0
0 -1 1
0 2 -1

输出样例 复制

2
1 3