文章
25
粉丝
364
获赞
8
访问
220.6k
/*
* Description: 生化武器2 (http://noobdream.com/DreamJudge/Issue/page/1124/)
* Author: 鱼翔浅底
* Date: 2021-02-17 12:30:09
*/
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
#define maxn 101
typedef struct
{
char map[maxn][maxn];
int sx, sy;
int gx, gy;
int n, m, t;
} ROOM;
typedef struct
{
int x, y;
int step;
} NODE;
bool BFS(ROOM &r)
{
char vis[maxn][maxn][2]; //标志有没有被访问过
const int dir[4][2] = {
-1, 0, //上
1, 0, //下
0, -1, //左
0, 1 //右
}; //方向
queue<NODE> Gq, Sq;
memset(vis, 0, sizeof(vis));
Gq.push(NODE{r.gx, r.gy, 0});
vis[r.gx][r.gy][0] = 1;
Sq.push(NODE{r.sx, r.sy, 0});
vis[r.sx][r.sy][1] = 1;
int cnt = 0;
while (!Gq.empty())
{
//毒气扩散
while (!Gq.empty())
{
NODE now = Gq.front();
...
登录后发布评论
暂无评论,来抢沙发