시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 22 | 8 | 8 | 44.444% |
Consider a maze marked with row and column numbers:
1 2 3 4 5 6 7 +-+-+-+-+-+-+-+ 1 | | + +-+-+-+-+-+ + 2 | | + +-+-+-+-+-+ + 3 | | | | | | + +-+ + +-+ + + 4 | | | | +-+-+-+-+-+-+-+
This maze has one exit (right hand side, first row). It is possible to reach the exit from many locations in the maze but not all of them (for instance, row 4, column 2).
Your task is to decide how many cells are isolated from an exit.
On a single line, output one integer that tells the number of cells from which one can not find a way to exit the maze.
4 7 +-+-+-+-+-+-+-+ | | + +-+-+-+-+-+ + | | + +-+-+-+-+-+ + | | | | | | + +-+ + +-+ + + | | | | +-+-+-+-+-+-+-+
7