시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 61 | 42 | 36 | 72.000% |
You just finished disking your field and it is time to head back to the farmhouse. Some of the livestock has been acting up (you think it is the Clydesdale horses but you’re not sure) and putting up obstacles to prevent you from getting home.
The first line contains a single positive integer, n, denoting the side length of the square field. The next n lines will consist of a map of your field, with ‘.’ denoting an open space and ‘x’ denoting an obstacle. You are in the top left corner of the field and the farmhouse is in the bottom right corner of the field. You don’t have a lot of gas in the tractor, so each move you make must be either down or right (no backtracking).
Print “Yes” if there is a simple path (down and right moves only) to your farm house. If there is no simple path print “No”.
6 ..x... .x.... ....x. xx.x.. ..x... ......
No
5 .x.x. ..... xxx.. ....x .x...
Yes