NYOJ 20 吝啬的国度
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=20邻接表+BFS#include #include #include #define MAX_N 100000using namespace std;int M;typedef pair P; ...
阅读全文
HDU 1242 Rescue
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1242可能会有多个朋友去救angel。。当一个朋友已经把守卫打死后,另一个朋友就不受该守卫的影响了所有,从A开始,搜索R比较容易实现....bfs#include #include #define MAX_N...
阅读全文
HDU 1253 胜利大逃亡
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1253宽度优先搜索:#include #include#include#define INF 10000000using namespace std;class p{public: int x; ...
阅读全文
NYOJ 58 最少步数
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=58经典的迷宫问题,,,,用BFS穷举:#include #include#include#include#define N 9using namespace std;const int INF=...
阅读全文