题号:NC231087
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
As for a 01-matrix(whose entries are all either 0 or 1, similarly hereinafter)

of size

, an index set

of the matrix is considered good if following two conditions are satisfied:
-
, for all
- For each entry
, there exists an index
satisfying the following two conditions at the same time:
·
or
Moreover, the value of a 01-matrix is the minimum size among all of its good index sets.
Now given a 012-matrix, you should replace all the 2 entries to 0 or 1, and determine the minimum possible value among all replacing schemes. As can be seen, there are totally

replacing schemes, where

denotes the number of 2 entries in the given matrix.
输入描述:
The first line contains two integers
, denoting the size of given 012-matrix.
Following
lines each contains one 012-string of length
, where the
-th character in the
-th line among the
lines denotes entry
.
输出描述:
Output one line containing one integer, denoting the minimum possible value after replacing.
示例1
输入
复制
3 7
0001101
0201020
0001101
说明
One possible replacing scheme is:

One possible good set of the minimum size is %2C(2%2C6)%2C(3%2C3)%5C%7D)