| Time Limit: 1000MS | Memory Limit: 65536K | 64bit IO Format: %I64d & %I64u |
Description
Consider the 4 x 4 board shown in Figure 1, where the solid circle identifies the start position and the dashed circle identifies the target. Figure 2 shows the three paths from the start to the target, with the irrelevant numbers in each removed.
![]() | ![]() |
| Figure 1 | Figure 2 |
Input
Output
Sample Input
4
2331
1213
1231
3110
4
3332
1213
1232
2120
5
11101
01111
11111
11101
11101
-1
Sample Output
3
0
7
Hint

883



被折叠的 条评论
为什么被折叠?



