本机上能过呀
#include<iostream>
using namespace std;
struct tp{
int x,y;
}f[10001];
int a[101][101];
tp start,end;
int n,m,t,ans;
void dfs(int fx,int fy)
{
if(fx<=0||fx>n||fy<=0||fy>m||a[fx][fy]==1)
{
return;
}
if(fx==end.x&&fy==end.y)
{
ans++;
return;
}
a[fx][fy]=1;
dfs(fx+1,fy);
dfs(fx,fy+1);
dfs(fx-1,fy);
dfs(fx,fy-1);
a[fx][fy]=0;
}
int main()
{
cin>>n>>m>>t;
cin>>start.x>>start.y;
cin>>end.x>>end.y;
for(int i=1;i<=t;i++)
{
cin>>f[i].x>>f[i].y;
a[f[i].x][f[i].y]=1;
}
dfs(start.x,start.y);
cout<<ans;
return 0;
}