第一个数据已经用fc对比过了是一摸一样的,为什么还是0分
#include<bits/stdc++.h>
using namespace std;
int n,m,q;
bool a[55][55];
int s,t;
int f[1010];
int sx[]= {0,-1,0,1,0};
int sy[]= {0,0,-1,0,1};
bool v[1010][55][55];
void dfs(int s,int t,int k) {
if(v[k][s][t]) return ;
v[k][s][t]=true;
if(k==0) return ;
while(true) {
s+=sx[f[k]];
t+=sy[f[k]];
if(!a[s][t]) break;
dfs(s,t,k-1);
}
}
int main() {
// freopen("P1189_1.in","r",stdin);
// freopen("6.txt","w",stdout);
scanf("%d%d",&n,&m);
char ch;
for(int i=1; i<=n; i++) {
getchar();
for(int j=1; j<=m; j++) {
ch=getchar();
if(ch=='.') a[i][j]=true;
if(ch=='*') a[i][j]=true,s=i,t=j;
if(ch=='X') a[i][j]=false;
}
}
scanf("%d",&q);
string x;
for(int i=q; i>=1; i--) {
cin>>x;
if(x=="NORTH") f[i]=1;
if(x=="WEST") f[i]=2;
if(x=="SOUTH") f[i]=3;
if(x=="EAST") f[i]=4;
}
dfs(s,t,q);
for(int i=1; i<=n; i++) {
for(int j=1; j<=m; j++) {
if(v[0][i][j]) cout<<'*';
else if(a[i][j]) cout<<'.';
else cout<<'X';
// cout<<a[i][j];
}
puts("");
}
return 0;
}