How would you solve this problem?

Revision en1, by 123gjweq2, 2025-03-30 20:05:47

You are given a grid with $$$n$$$ rows and $$$m$$$ columns filled with zeros and ones. In one move, you can choose any cell in the grid and flip all of the bits in the adjacent cells. You do not flip the bit in the cell you chose.

For example, if you choose the cell $$$(3, 1)$$$ and then the cell $$$(2, 2)$$$.

0 0 0      0 0 0      0 1 0
0 0 0 ->   1 0 0 ->   0 0 1
0 0 0      0 1 0      0 0 0

You are given that you can make the grid into all zeros in some number of operations. Find the minimum number of operations to make the grid all zeros and output any minimum sequence of operations.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English 123gjweq2 2025-03-30 20:05:47 635 Initial revision (published)