Editorial for CCC '21 S2 - Modern Art
Submitting an official solution before solving the problem yourself is a bannable offence.
There is only one cell, so only the number of operations matters.
Keep track of the cells using a 1D array, and simulate each operation.
The solution is the same as the previous subtask, except a 2D array must be used instead.
One way to solve the problem is to realize that the colour of a square is dependent on the parity of the number of operations performed on its row and column. We can keep track of the counts using two frequency arrays, and then loop over each cell in the grid to check its colour.