2012年7月24日

hdu 1180 诡异的楼梯

摘要: 点击打开链接 复杂bfs... 需要讨论开始为 | 还是 - #include"stdio.h"#include"string.h"#include"queue"using namespace std;int dir[4][2]={1,0,0,1,-1,0,0,-1};int map[21][... 阅读全文

posted @ 2012-07-24 20:47 Slege 阅读(110) 评论(0) 推荐(0) 编辑

hdu 1372 Knight Moves

摘要: 点击打开链接 走的是日。。。 #include"stdio.h"#include"string.h"#include"queue"using namespace std;int dir[8][2]={{-2,1},{2,-1},{-1,2},{1,-2},{-1,-2},{-2,-1},{... 阅读全文

posted @ 2012-07-24 19:29 Slege 阅读(62) 评论(0) 推荐(0) 编辑

hdu 2822 dogs

摘要: 点击打开链接 BFS。。。 #include"stdio.h"#include"string.h"#include"queue"using namespace std;int dir[4][2]={{0,1},{0,-1},{1,0},{-1,0}};int map[1010][1010];ch... 阅读全文

posted @ 2012-07-24 19:27 Slege 阅读(90) 评论(0) 推荐(0) 编辑

hdu 1175 连连看

摘要: 点击打开链接 与1728类似,但写出来后一直超时。。。 最后把数组改为1001(原来为1024),就AC了。。 #include"stdio.h"#include"string.h"#include"queue"using namespace std;int dir[4][2]={1,0,... 阅读全文

posted @ 2012-07-24 19:25 Slege 阅读(89) 评论(0) 推荐(0) 编辑

hdu 1495 非常可乐

摘要: 点击打开链接 大意:有三个杯子,开始时第一个杯子装满水(体积为a)。。。。倒来倒去,得到其中2个杯里的水的体积都为 a/2。。。。求最小次数。。。。不存在就输出NO。。。。 从图(以前都是图题)的点转化成状态(这题比较现实化)。。。。 struct point//a,b,c是某一状态下三个... 阅读全文

posted @ 2012-07-24 19:20 Slege 阅读(164) 评论(0) 推荐(0) 编辑

hdu 1728 逃离迷宫

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1728 该死的杭电。读入的时候竟然先读入纵坐标。。。 开始以为是单纯的BFS,结果WA无数次.后来分析后发现因为是要找到最少转向路径,所以要每个方向搜到尽头. 两个AC代码。。 #include"st... 阅读全文

posted @ 2012-07-24 15:51 Slege 阅读(103) 评论(0) 推荐(0) 编辑

导航