
BFS
qq_41555192yl
吾往矣...
展开
-
Rescue(广度优先搜索 BFS)
网址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=649Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There a...原创 2018-07-31 13:28:41 · 229 阅读 · 0 评论 -
C - Catch That Cow (BFS)
网址:https://vjudge.net/contest/242570#problem/C农夫知道一头牛的位置,想要抓住它。农夫和牛都于数轴上 ,农夫起始位于点 N(0<=N<=100000) ,牛位于点 K(0<=K<=100000) 。农夫有两种移动方式: 1、从 X移动到 X-1或X+1 ,每次移动花费一分钟 2、从 X移动到 2*X ,每次移动花费一分钟 假设...原创 2018-07-31 17:50:45 · 364 阅读 · 0 评论 -
D - Dungeon Master
Description - 题目描述[NWUACM] 你被困在一个三维的空间中,现在要寻找最短路径逃生!空间由立方体单位构成你每次向上下前后左右移动一个单位需要一分钟你不能对角线移动并且四周封闭是否存在逃出生天的可能性?如果存在,则需要多少时间?Input - 输入 输入第一行是一个数表示空间的数量。 每个空间的描述的第一行为L,R和C(皆不超过30)。 L表示空间...原创 2018-08-01 23:15:08 · 153 阅读 · 0 评论 -
J - 迷宫问题 (BFS及打印路径)
定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 ×...原创 2018-08-01 23:09:21 · 201 阅读 · 0 评论 -
A - Red and Black (bfs || dfs)
网址:https://vjudge.net/contest/241948#problem/AThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can...原创 2018-08-01 22:49:54 · 167 阅读 · 0 评论