I have a doubt in the given example for the question. I’m pasting the question text below:
(copied from the pdf available at: https://www.iarcs.org.in/inoi/2012/zio2012/zio2012-qpaper.pdf)
You are given a grid of cells. Each cell has a positive integer written on it. You can
move from a cell x to a cell y if x and y are in the same row or same column, and the
number in y is strictly smaller than the number in x. You want to color some cells
red so that:
- Every cell can be reached by starting at a red cell and following a sequence of zero or more moves as defined above.
- The number of red cells is as small as possible.
You should report the following information:
- The number of red cells.
- The smallest number appearing amongst all red cells.
If there are multiple valid solutions, give any one solution
For example, suppose the grid is as follows:
2 2 3
2 1 2
3 2 2
It is sufficient to color the two cells labelled 3, and one cannot do better than this.
In this case, the number of red cells is 2 and the smallest number appearing amongst
all red cells is 3.
(followed by three grids, for which the student has to provide the answer)
What I’m understanding is that a cell (x,y) is reachable ONLY if at least one of its adjacent cells contain a number STRICTLY GREATER than the number in cell (x,y), or it is adjacent to a red cell. So, in the example given, if we color the cells containing ‘3’, at (1,3) and (3,1), all cells will be reachable except the cells containing ‘2’ at (1,1) and (3,3). These two cells, i.e. (1,1) and (3,3) don’t have any adjacent cell which is colored or has a number strictly greater than itself.
I would also color the cells at (1,1) and (3,3). Hence my answer for the example is:
- No. of colored cells : 4
- Least number among the colored cells : 2
My interpretation renders the example incorrect. And so I believe I’m missing out some important fact in the question. Don’t give me the logic to solve the question; just tell me how the given example in question is correct.