bfs
兔兔不爱吃萝卜
小菜鸡在努力的呀
展开
-
1455: [蓝桥杯2019初赛]迷宫(bfs+路径存储)
代码: #include <iostream> #include <algorithm> #include <cstring> #include <queue> using namespace std; #define x first #define y second typedef pair<int,int> PII; const int N=55; char g[N][N]; string f[N][N]; int dist[N][N]; i.原创 2022-04-04 17:02:38 · 493 阅读 · 0 评论 -
J - Borg Maze(最小生成树+bfs)
这里写目录标题最小数二级目录三级目录 最小数 二级目录 三级目录 项目 Value 电脑 $1600 手机 $12 导管 $1 Column 1 Column 2 centered 文本居中 right-aligned 文本居右原创 2021-08-13 10:14:07 · 113 阅读 · 0 评论 -
J - Find a way(bfs)
#include <iostream> #include <queue> #include <cstring> using namespace std; int dx[]={0,0,1,-1}; int dy[]={1,-1,0,0}; int m,n; char map[222][222];//输入的 int yyy[222][222];//Y移动的次数 int mmm[222][222];//M移动的次数 int yx,yy,mx,my; struct node {.原创 2021-06-02 13:37:34 · 67 阅读 · 0 评论 -
H - Open the Lock(bfs)
#include <iostream> #include <queue> #include <cstring> using namespace std; struct node { int a[4],step; }; char str[2][5]; int f[4]; bool vis[10][10][10][10];//这里不能在这赋值为0,要在下面赋值 int BFS()//有返回值,用int { node now,next; for(int.原创 2021-06-01 14:35:30 · 54 阅读 · 0 评论 -
C - Dungeon Master(bfs)
#include <cstdio> #include<iostream> #include<memory.h> #include<queue> #include<stack> #include<algorithm> #include<cmath> #include<vector> #include<cstdlib> #include<iterator> #include<cstri.原创 2021-05-31 22:48:39 · 130 阅读 · 0 评论 -
D - Catch That Cow(bfs)
#include<cstdio> #include<iostream> #include<algorithm> #include<stdio.h> #include<math.h> #include<string.h> #include<map> #include<vector> #include<queue> #include<set> using namespace std; int.原创 2021-05-30 15:34:05 · 82 阅读 · 0 评论 -
F - 迷宫问题(bfs)
#include<cstdio> #include<iostream> #include<algorithm> #include<stdio.h> #include<math.h> #include<string.h> #include<map> #include<vector> #include<queue> using namespace std; int a[106][106]; int pr.原创 2021-05-30 10:40:24 · 93 阅读 · 0 评论