题意:在一个迷宫中,从特定起点开始走向特定终点。输出三种走法的步数:1、向左优先 2、向右优先 3、任意走法的最短步数。
解法:前两种都是一直深搜。第三种用模拟队列实现广搜。
#include
#include
#include
#include
using namespace std;
char maze[45][45];
int num[2][4]{0,-1,0,1,
int num2[2][4]{0,-1,0,1,
struct point
{
} points[10000];
int m,n;
int startx,starty,endx,endy;
bool OK(int a,int b)
{
}
int dfsleft(int a,int b,int c)
{
}
int dfsright(int a,int b,int c)
{
}
bool yes(point a)
{
}
int main()
{
}