摘要: 题意: M行N列矩阵, 'Y'表示开始位置, 'T'表示目标位置, 从开始位置到目标位置至少需要走多少步,其中, 'S', 'R'表示不能走, 'B' 花费为2, 'E'花费为1.思路:纯 BFS.很久没写BFS, 刚写居然不知道从何下手... 1 #include <iostream> 2 #include <queue> 3 using namespace std; 4 5 struct postion 6 { 7 int i, j; 8 postion operator 阅读全文
posted @ 2013-06-21 14:43 旅行的蜗牛 阅读(170) 评论(0) 推荐(0) 编辑