Problems > Black Squares > Editorial

Black Squares — Solution & Editorial

Back to the Problem

Black cells are those with even (r+c); counting them gives ceil(NM/2) when (1,1) is black.

Complexity: O(1)