Logo
(追記) (追記ここまで)

27099번 - Trapped 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB48191945.238%

문제

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.

입력

  • Line 1: two space-separated integers R,C (1 ≤ R,C ≤ 35) that tell the number of rows and columns for the maze
  • Lines 2..2*R+2: An ASCII map of the matrix just as above. Walls are marked by '_' and '|'. Wall intersections (and potential wall intersections) are marked by '+'.

출력

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.

제한

예제 입력 1

4 7
+-+-+-+-+-+-+-+
| |
+ +-+-+-+-+-+ +
| |
+ +-+-+-+-+-+ +
| | | | | |
+ +-+ + +-+ + +
| | | |
+-+-+-+-+-+-+-+

예제 출력 1

7

힌트

출처

Olympiad > USA Computing Olympiad > 1999-2000 Season > USACO Spring 2000 Contest > Orange 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /