bfs
纯纯的心儿
每天都在赚事业。。
展开
-
hdu 1072 Nightmare
该题是一个bfs题 运用了 优先队列的方法,实现最小步数。 注意一点是 计时器恢复只能用一次。 #include #include #include #include #include using namespace std; int dd[4][2]={0,1,1,0,0,-1,-1,0}; int map[10][10]; int bbs,n,m,i,j,shix,sh原创 2015-04-02 23:49:04 · 326 阅读 · 0 评论 -
hdu 2012 A计划
该题是典型的bfs 和队列的结合~~~ #include #include #include using namespace std; struct node { int x,y,k; int time; friend bool operator<(node a,node b) //优先队列 a小的优先级高 { return a.time>b.time; } };原创 2015-04-02 00:32:16 · 418 阅读 · 0 评论 -
hdu 2216 Game III
Problem Description Zjt and Sara will take part in a game, named Game III. Zjt and Sara will be in a maze, and Zjt must find Sara. There are some strang rules in this maze. If Zjt move a step, Sara原创 2015-04-05 23:07:48 · 449 阅读 · 0 评论