文章
13
粉丝
0
获赞
113
访问
1.7k
#include<bits/stdc++.h>
using namespace std;
struct node{
int x,y;
};
const int maxn = 105;
char mpt[maxn][maxn];
int dir[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
node G,S;
int N,M,t;
int bfs(int t){
queue<node> qg,qs;
qg.push(node{G.x,G.y});
qs.push(node{S.x,S.y});
int sum=1;
while(t--){
int qgsize = qg.size();
if(qgsize==0)break;
while(qgsize--){
node now = qg.front();
qg.pop();
for(int i = 0;i<4;i++){
int nx = now.x + dir[i][1];
&nbs...
登录后发布评论
暂无评论,来抢沙发