
bfs
土方
这个作者很懒,什么都没留下…
展开
-
hdu1548-A strange lift BFS
1548 Sample Input 5 1 5 //5层楼 当前位置1楼 目标5楼 3 3 1 2 5 //1楼只可以按3,不能再下,到了4楼;4楼只能按2,到了2楼;2楼按3到了五楼 0 Sample Output 3 // 最少按了3次键 #include #include #i原创 2016-08-16 09:41:53 · 336 阅读 · 0 评论 -
hdu1372-Knight Moves BFS
1372 求从他给的坐标走到另一个坐标需要多少步数,字母数字代表行列 走的规则就像马走日一样(可以先横走一步再竖两步,或者竖两步横一步一共有八个方向) #include #include #include #include using namespace std; char map[9][9]; int judge[9][9]; int s1,s2,e1,e原创 2016-08-16 09:56:19 · 264 阅读 · 0 评论