| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 6 초 | 1024 MB | 46 | 32 | 29 | 69.048% |
Two players play the following game on an $N \times M$ grid:
A winning starting cell is a cell such that the first player wins the game if they place their starting stone there, assuming both players play optimally. Given a description of the initial grid, you must tell how many winning starting cells it has.
The first line contains two integers $N$ and $M$ (1ドル ≤ N, M ≤ 50$) indicating the dimensions of the grid.
Each of the next $N$ lines contains a string of length $M$. In the $i$-th string, the $j$-th character describes the initial state of cell $(i, j)$. The character is either “.” (dot) denoting an empty cell, or “#” (hash) representing an occupied cell.
Output a single line with an integer indicating the number of winning starting cells.
3 3 #.# ... #.#
4
3 3 ..# ... ...
0
1 4 ...#
2