Let me tell you the things that I have been thinking for a long time.
You are given an
n×nn\times nn×n matrix
AAA with each number in
AAA either
000 or
111.
You can do the following operation on
AAA any number of times (possibly zero):
-
Choose a row or a column from AAA, and flip it (i.e. all the 000s in that row or column become 111s, and all the 111s become 000s).
Define
rir_iri as
(Ai1Ai2…Ain‾)2(\overline{A_{i1}A_{i2}\dots A_{in}})_2(Ai1Ai2…Ain)2, which means writing all the number in the
iii-th row from left to right, forming a binary number
rir_iri.
Define
cjc_jcj as
(A1jA2j…Anj‾)2(\overline{A_{1j}A_{2j}\dots A_{nj}})_2(A1jA2j…Anj)2, which means writing all the number in the
jjj-th column from top to bottom, forming a binary number
cjc_jcj.
Note that
rir_iri and
cjc_jcj may change after operations.
Determine whether you can achieve
min(ri)≥max(cj)\min(r_i)\geq \max(c_j)min(ri)≥max(cj) by operations. If so, find out the minimal number of operations needed.