搜索 - 多源bfs
多源bfs
// 思路
建立虚拟源点,将所有起点加入队列中
1.题目1
#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
const int N = 1010;
typedef pair<int,int> PII;
int dis[N][N];
char g[N][N];
queue<PII> q;
int n,m;
void bfs()
原创
2021-03-04 21:17:02 ·
111 阅读 ·
1 评论