On Sunday, 16 July 2017 at 21:50:19 UTC, kerdemdemir wrote:

                        Process(row-1,column-1, maxrow, maxcolumn);
                        Process(row,column-1, maxrow, maxcolumn);
                        Process(row+1,column-1, maxrow, maxcolumn);
                        Process(row-1,column, maxrow, maxcolumn);
                        Process(row+1,column, maxrow, maxcolumn);
                        Process(row-1,column+1, maxrow, maxcolumn);
                        Process(row,column+1, maxrow, maxcolumn);
                        Process(row-1,column+1, maxrow, maxcolumn);

One of "row-1,column+1" should actually be "row+1,column+1". That's where the mentioned ways help.

As for the problem itself, it can be solved without finding connected components. I won't post the solution right away because it is potentially a spoiler. See http://codeforces.com/blog/entry/53268 for problem analysis (828B) and http://codeforces.com/contest/828/submission/28637184 for an example implementation in D.

Ivan Kazmenko.

Reply via email to