BFS
author:vehicel
description :BFS
chstor
努力学好英语的菜狗
展开
-
Catch That Cow
题目:Catch That Cow 题目大意: *行走:FJ可以在一分钟内从任意点X移动到点X - 1或X + 1 *传送:FJ可以在一分钟内从任意X点移动到2 * X点 n,k范围在(0-1e5)之间,不在范围内不考虑 代码如下: #include<iostream> #include<cstring> #include<queue> using namespace std; #define inf 0x3f3f3f3f #define mm(a,x) mem原创 2020-11-01 22:02:28 · 108 阅读 · 1 评论 -
Dungeon Master
题目:Dungeon Master 题目大意: 从起点(‘S’)坐标到终点(‘E’)坐标的最短距离,有6个方向:上,下,东,西,南,北 数据偏小,三维BFS求最短距离 代码如下: #include<iostream> #include<cstring> #include<queue> using namespace std; #define inf 0x3f3f3f3f #define mm(a,x) memset(a,x,sizeof a) const i原创 2020-11-01 21:38:35 · 379 阅读 · 0 评论