May cook off 2019 division2 "REACTION"

This is said in the problem statement - “A cell in the grid is stable if the number of cells in the grid which are adjacent to this cell is strictly greater than the value written in this cell”. But the accepted solutions have the condition as greater than or equal to.

Here is link to code that had strictly greater condition:
https://www.codechef.com/viewsolution/24323515

Here is link to some solution that had greater than or equal to condition which were all accepted:
https://www.codechef.com/viewsolution/24324309 (python solution)
https://www.codechef.com/viewsolution/24324345 (c++ solution)

I request the problem setter to kindly look into the matter.

From what i see you are setting flag to 1 if the condition is violated and according to you in the example

1 2 1
2 3 2
1 2 1

array[2,2] (taking 1 based indexing)can be 4 but not greater than 4 (no. of adjacent cells).

But the question says “strictly greater than the value written” so the value written can’t be greater than or equal to 4, it has to be less than 4 (no. of adjacent cells).

1 Like