应该最后再pop吧
by Llf0703 @ 2018-04-21 12:38:12
@[Ofnoname](/space/show?uid=73489)
by Llf0703 @ 2018-04-21 12:38:38
```cpp
void bfs(int a,int b)
{
x=y=queue<int>();
x.push(a);
y.push(b);
while (!x.empty()&&!y.empty())
{
xf=x.front();
yf=y.front();
for (int i=0;i<4;i++)
if (chong[xf+fx[i]][yf+fy[i]]==0&&jz[xf+fx[i]][yf+fy[i]]==0&&xf+fx[i]>=1&&xf+fx[i]<=n&&yf+fy[i]>=1&&yf+fy[i]<=n)
{
x.push(xf+fx[i]);
y.push(yf+fy[i]);
jz[xf+fx[i]][yf+fy[i]]=-1;
}
x.pop();
y.pop();
}
}
```
by Llf0703 @ 2018-04-21 12:40:03
已经AC了
by AlgoEmperor @ 2018-04-21 14:31:08