BFS
文章平均质量分 77
Mason_xm
这个作者很懒,什么都没留下…
展开
-
Battle City
Battle City (坦克大战) POJ - 2312 Many of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now. What we are discussing is a simple ...原创 2018-08-23 20:01:22 · 308 阅读 · 0 评论 -
Catch That Cow
Catch That Cow POJ - 3278 农夫知道一头牛的位置,想要抓住它。农夫和牛都于数轴上 ,农夫起始位于点 N(0<=N<=100000) ,牛位于点 K(0<=K<=100000) 。农夫有两种移动方式: 1、从 X移动到 X-1或X+1 ,每次移动花费一分钟 2、从 X移动到 2*X ,每次移动花费一分钟 假设牛没有意识到农夫的行动,站在原地不。...原创 2018-08-23 20:04:54 · 93 阅读 · 0 评论 -
Dungeon Master
Dungeon Master POJ - 2251 Description - 题目描述 [NWUACM] 你被困在一个三维的空间中,现在要寻找最短路径逃生! 空间由立方体单位构成 你每次向上下前后左右移动一个单位需要一分钟 你不能对角线移动并且四周封闭 是否存在逃出生天的可能性?如果存在,则需要多少时间? Input - 输入 输入第一行是一个数表示空间的数量。 每个空间...原创 2018-08-23 20:09:07 · 145 阅读 · 0 评论 -
Robot Motion
Robot Motion POJ - 1573 A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instru...原创 2018-08-23 20:24:02 · 114 阅读 · 0 评论 -
Knight Moves
Knight Moves HDU - 1372 A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given se...原创 2018-08-23 20:29:17 · 160 阅读 · 0 评论 -
迷宫问题
POJ - 3984 定义一个二维数组: 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表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。 ...原创 2018-08-24 11:40:18 · 155 阅读 · 0 评论