求助大佬,怎么一直报错呀?
辣祭代码:
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n, m;
LL dx[4] = {0, 0, 1, -1};
LL dy[4] = {1, -1, 0, 0};
string dps[114514];
bool ss[114514][114514];
void dfs(LL x, LL y)
{
for(int i = 0; i < 4; i ++)
{
LL tx = 1;
LL ty = 1;
ss[x][y] = 1;
if(tx >= 1 && tx <= n && ty >= 1 && ty <= m && dps[x + tx[i]][y + ty[i]] == '.' && ss[x + tx[i]][y + ty[i]] == 0)
{
dfs(x + tx[i],y + ty[i]);
}
}
return ;
}
int main()
{
cin >> n >> m;
for(int i = 1; i <= n; i ++)
{
for(int j = 1; j <= m; j ++)
{
cin >> dps[i][j];
}
}
dfs(1, 1);
if(dps[n][m] == 1)
{
cout << "Yes";
}
else
{
cout << "No";
}
return 0;
}