首页 > A-逃脱
头像 _Faker_
发表于 2023-07-17 11:22:53
###强行BFS 见代码 #include <iostream> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <s 展开全文
头像 独木桥ing
发表于 2022-04-21 20:27:59
//两次BFS(通俗易懂) #include<bits/stdc++.h> using namespace std; char g[35][35]; int mx,my,n,m,nx,ny; int dis1[35][35],dis2[35][35]; int dx1[]={-1,-1, 展开全文
头像 Polaris_jielun
发表于 2021-07-22 19:22:07
刚刚开始看到标签,想使用dfs。但是没有写出来(确信),后面去看看博客,发现都用bfs写的,然后试着写了一下。 AC代码 #include<bits/stdc++.h>; using namespace std; int n, m, t; #define Max 35 int move1 展开全文
头像 A_normal_man
发表于 2022-09-14 16:11:44
用数组维护可以走的方向和火移动的方向。 BFS: 可以将‘S’所在的地方扩散出去,如果是'#''F''S'就不能扩散,反之则可以,用队列维护边缘坐标。 记住:当边缘坐标被火吞没时,该坐标不能移动,这需要特别判定。 #include<iostream> #include<algori 展开全文