#P1605. 迷宫
迷宫
Description
Given an grid maze with obstacles, where obstacle cells are impassable.
Movement is allowed in four directions: up, down, left, and right, moving exactly one cell per step. It is guaranteed that the starting cell has no obstacle.
Given the start coordinates and the end coordinates, with each cell visited at most once, find the number of different paths from the start to the end.
Input Format
The first line contains three positive integers , representing the numbers of rows and columns of the maze and the total number of obstacles.
The second line contains four positive integers . are the start coordinates, and are the end coordinates.
The next lines each contain two positive integers, representing the coordinates of an obstacle.
Output Format
Output the total number of paths from the start to the end.
2 2 1
1 1 2 2
1 2
1
Hint
For of the testdata, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号