随笔分类 - 搜索—迭代加深
摘要:题目大意:01矩阵,1表示黑色,0表示白色,求将白色染成黑色最少的次数 使黑色成为一整个联通块。 题解: 搜索bfs 90... dfs判断连通 #include<iostream> #include<cstdio> #include<cstring> #include<queue> using n
阅读全文
摘要:题目描述 A little known fact about Bessie and friends is that they love stair climbing races. A better known fact is that cows really don't like going dow
阅读全文
摘要:题目描述 在3×3的棋盘上,摆有八个棋子,每个棋子上标有1至8的某一数字。棋盘中留有一个空格,空格用0来表示。空格周围的棋子可以移到空格中。要求解的问题是:给出一种初始布局(初始状态)和目标布局(为了使题目简单,设目标状态为123804765),找到一种最少步骤的移动方法,实现从初始布局到目标布局的
阅读全文

浙公网安备 33010602011771号