1669: and, or, xor

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:23 解决:1

题目描述

Given a M×N matrix A. Aij ∈ {0, 1} (0 ≤ i < M, 0 ≤ j < N), could you find some rows that let every cloumn contains and only contains one 1.

输入

There are multiple cases ended by EOF. Test case up to 500.The first line of input is M, N (M ≤ 16, N ≤ 300). The next M lines every line contains N integers separated by space.

输出

For each test case, if you could find it output "Yes, I found it", otherwise output "It is impossible" per line.

样例输入 复制

3 3
0 1 0
0 0 1
1 0 0
4 4
0 0 0 1
1 0 0 0
1 1 0 1
0 1 0 0

样例输出 复制

Yes, I found it
It is impossible

提示

dlx算法或位运算优化

来源/分类