#d2126. 路径计数
路径计数
Path Counting
Problem Description
There is an grid; some cells are passable and some are obstacles.
You start at the top-left corner and may move down or right one step at a time each move. Count the number of ways to reach the bottom-right corner.
Since the answer may be large, output it modulo .
Input Format
The first line contains a positive integer .
The following lines each contain positive integers; means passable and means blocked.
Output Format
One integer: the answer.
Sample Input
3
1 1 1
1 0 1
1 1 1
Sample Output
2
Constraints
For of the data, , and both the top-left and bottom-right corners are passable.