RT,10pts
我将#1数据下下来看了的,输出是对的,但评测机WA得都说我输出的0
#include <bits/stdc++.h>
using namespace std;
int r1,c1,r2,c2,n,m,T,ans;
char a[105][105];
bool check(int x,int y){
if(x>=1&&x<=n&&y>=1&&y<=m)return true;
return false;
}
void dfs(int x,int y,int t){
if(t>T)return ;
if(check(x,y)){
if(x==r2&&y==c2&&t<=T){
ans++;
return ;
}
if(a[x+1][y]!='*')dfs(x+1,y,t+1);
if(a[x-1][y]!='*')dfs(x-1,y,t+1);
if(a[x][y+1]!='*')dfs(x,y+1,t+1);
if(a[x][y-1]!='*')dfs(x,y-1,t+1);
}
}
int main(){
ios::sync_with_stdio(false);
scanf("%d%d%d",&n,&m,&T);
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>a[i][j];
}
}
scanf("%d%d%d%d",&r1,&c1,&r2,&c2);
dfs(r1,c1,0);
printf("%d\n",ans);
return 0;
}