hdu 1195 Open the Lock 双广
摘要:
//题目大意:求解开4位密码锁的最少步数.//<变化一次:加1;减1;邻位交换>思路:简单bfs能过,时间很高,双bfs好点。简单bfsView Code #include <stdio.h>#include <string.h>#include <stdlib.h>#include <iostream>#include <queue>#include <algorithm>using namespace std;struct nd{ int num,st;};int hash[10000];int s,t;i 阅读全文
posted @ 2012-06-05 23:58 aigoruan 阅读(187) 评论(0) 推荐(0)