文章
1
粉丝
0
获赞
3
访问
149
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define ll long long
#define MAXLEN 100005
char mpt[35][35];
int vis[35][35];
int dis[4][2]={
{0,1},
{1,0},
{-1,0},
{0,-1}
};
struct node{
int x;
int y;
int time;
};
void BFS(int sx,int sy,int t){
queue<node> q;
q.push(node{sx,sy,t});
while(!q.empty()){
node now=q.front();
q.pop();
int t=now.time;
for(int i=0;i<4;i++){
int nx=now.x+dis[i][0];
int ny=now.y+dis[i][1];
if(mpt[nx][ny]=='.'&&vis[nx][ny]==0&...
登录后发布评论
暂无评论,来抢沙发