Coder

舒心、快乐,比什么都重要

随笔分类 -  BFS & DFS

摘要:/* 就是二维变成了三维,模版题。*/#include <iostream> #include <cstring> #include <string> #include <queue> using namespace std; int k,a,b,c,t; int mp[55][55][55]; b 阅读全文
posted @ 2020-03-13 10:26 H123K 阅读(152) 评论(0) 推荐(0)
摘要:/* 要注意使用优先队列,成功的路有长有短。 */ #include <iostream> #include <cstring> #include <queue> using namespace std; int n,m,sx,sy; char mp[222][222]; bool vis[222] 阅读全文
posted @ 2020-03-12 09:40 H123K 阅读(157) 评论(0) 推荐(0)
摘要:/* * @Author: LinHaiCheng * @Date: 2020-03-11 11:42:52 * @Last Modified by: mac * @Last Modified time: 2020-03-11 15:04:12 */ #include <iostream> #inc 阅读全文
posted @ 2020-03-11 15:08 H123K 阅读(148) 评论(0) 推荐(0)
摘要://Problem B /* BFS找路,判断楼梯状态,如果到达楼提前的步数是奇数 那么便可快速通过楼梯,反之不能 如果使用普通队列可能会出现步数大的结果,或者遍历所有情况再排查最小的情况 优先队列则可以解决该问题,让步数小的排在前,减少麻烦 */ #include <iostream> #incl 阅读全文
posted @ 2020-03-10 22:55 H123K 阅读(174) 评论(0) 推荐(0)