宽搜

2024/10/21 11:33:15

蓝桥杯-AB路线(详细原创)

问题描述: 有一个由 N M 个方格组成的迷宫,每个方格写有一个字母 A 或者 B。小蓝站在迷宫左上角的方格,目标是走到右下角的方格。他每一步可以移动到上下左右相邻的方格去。 由于特殊的原因,小蓝的路线必须先走 K 个 A 格子、再…

蓝桥杯-AB路线(详细原创)

问题描述: 有一个由 N M 个方格组成的迷宫,每个方格写有一个字母 A 或者 B。小蓝站在迷宫左上角的方格,目标是走到右下角的方格。他每一步可以移动到上下左右相邻的方格去。 由于特殊的原因,小蓝的路线必须先走 K 个 A 格子、再…

openjudge_2.5基本算法之搜索_200:Solitaire

题目 200:Solitaire 总时间限制: 5000ms 单个测试点时间限制: 1000ms 内存限制: 65536kB 描述 Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right resp…

openjudge_2.5基本算法之搜索_200:Solitaire

题目 200:Solitaire 总时间限制: 5000ms 单个测试点时间限制: 1000ms 内存限制: 65536kB 描述 Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right resp…

openjudge_2.5基本算法之搜索_2152:Pots

题目 2152:Pots 总时间限制: 1000ms 内存限制: 65536kB 描述 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) empty the pot i to the…

蓝桥杯-AB路线(详细原创)

问题描述: 有一个由 N M 个方格组成的迷宫,每个方格写有一个字母 A 或者 B。小蓝站在迷宫左上角的方格,目标是走到右下角的方格。他每一步可以移动到上下左右相邻的方格去。 由于特殊的原因,小蓝的路线必须先走 K 个 A 格子、再…

[Algorithm][队列][宽搜BFS][N叉树的层序遍历][二叉树的锯齿形层序遍历][二叉树最大宽度][在每个树行中找最大值]详细讲解

目录 1.N 叉树的层序遍历1.题目链接2.算法思路详解3.代码实现 2.二叉树的锯齿形层序遍历1.题目链接2.算法原理详解3.代码实现 3.二叉树最大宽度1.题目链接2.算法原理详解3.代码实现 4.在每个树行中找最大值1.题目链接2.算法原理详解3.代码实现 1.N 叉树的层序遍历 1.题目链接 …

算法笔记(十)——队列+宽搜

文章目录 N 叉数的层序遍历二叉树的锯齿形层序遍历二叉树最大宽度在每个树行中找最大值 BFS是图上最基础、最重要的搜索算法之一; 每次都尝试访问同一层的节点如果同一层都访问完了,再访问下一层 BFS基本框架 void bfs(起始点) {将起始点放入队列中;标记…

openjudge_2.5基本算法之搜索_2152:Pots

题目 2152:Pots 总时间限制: 1000ms 内存限制: 65536kB 描述 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) empty the pot i to the…

蓝桥杯-AB路线(详细原创)

问题描述: 有一个由 N M 个方格组成的迷宫,每个方格写有一个字母 A 或者 B。小蓝站在迷宫左上角的方格,目标是走到右下角的方格。他每一步可以移动到上下左右相邻的方格去。 由于特殊的原因,小蓝的路线必须先走 K 个 A 格子、再…

openjudge_2.5基本算法之搜索_2152:Pots

题目 2152:Pots 总时间限制: 1000ms 内存限制: 65536kB 描述 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) empty the pot i to the…