搜索
A_Eagle
人生苦短,及时行乐
展开
-
NYOJ 27 水池数目
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=27 这应该属于最简单的搜索题了,直接水过。。。。。。 代码: #include #include int s,t,a[101][101]; int dx[4]={0,0,1,-1};//**四个方向搜索**// int dy[4]={1,-1,0,0}; void bfs(in原创 2012-02-12 21:55:09 · 1874 阅读 · 2 评论 -
NYOJ 10 skiing
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=10 还是搜索题,加上了DP的思想,看过书上面说搜索不剪枝就会超时,貌似这题。。。。。。,没减也能过,测试数据 的问题。属于简单的搜索题。。。。。 代码: #include #include int a[101][101],visit[101][101]; int dx[4]={0,0原创 2012-02-13 20:38:38 · 1348 阅读 · 0 评论 -
NYOJ 54 最少步数
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=58 广搜问题,每个步骤的含义都写在代码里面了。欢迎大家相互交流, 代码: #include #include #include #include using namespace std; int a[9][9]=//**迷宫地图**// { 1,1,1,1,1,1,1,1,1,原创 2012-01-06 10:34:21 · 2404 阅读 · 1 评论