#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
const int maxn=100;
bool vst[maxn][maxn]; // 访问标记
int dir[4][2]= {
0,1,0,-1,1,0,-1,
BFS模板
最新推荐文章于 2023-02-13 19:27:54 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
const int maxn=100;
bool vst[maxn][maxn]; // 访问标记
int dir[4][2]= {
0,1,0,-1,1,0,-1,