![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
bfs
文章平均质量分 68
laserss
laserss@qq.com
展开
-
pku3083Children of the Candy Corn-模拟+bfs
pku3083Children of the Candy Corn模拟的部分写了一下午写bfs的时候还不知道什么是bfs……然后去写bfs模板题(记录在前两篇博客里)然后贴bfs完成后就一直Runtime Error。。。因为开的数组是 mp[40][40] ,然后数据里正好有 40*40 就杯具的Runtime Error了十多次#includ原创 2012-08-16 15:50:45 · 633 阅读 · 2 评论 -
hdu1242 Rescue
hdu1242 Rescue广搜的模板弄明白之后就觉得……太简单了#include#includeusing namespace std;char mp[201][201];int m,n,dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}};struct point{ int x,y,step; friend bo原创 2012-08-16 13:08:51 · 788 阅读 · 0 评论 -
hdu1072 nightmare
hdu1072 nightmare……跟hdu1242有些不同走过的路可以返回所以不要标记,换炸弹的倒计时限制队列的增长#include#include#includeusing namespace std;int mp[10][10],m,n,Sx,Sy,Dx,Dy,flag,dir[4][2]={{0,1},{0,-1},{1,0},{-1,0原创 2012-08-16 14:58:08 · 688 阅读 · 0 评论 -
hdu1582AC again-bfs
#includeusing namespace std;char mp[60][60];int num;void bfs(int x,int y){ if(x51||y51) return; if('*'==mp[x][y]) return; mp[x][y]='*'; bfs(x-1,y); bfs(x,y-1); bfs(x,y+1); bfs(x原创 2012-10-13 15:46:43 · 781 阅读 · 0 评论 -
hdu2102 双层bfs
hdu2102当传送的目的地是墙或者仍是传送机的时候就不要去了,把他当做墙.#include#includeusing namespace std;struct point{ int x,y,step,type;} P[105];char mp[2][12][12];int M,N,T,dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}原创 2012-10-31 20:18:06 · 2200 阅读 · 1 评论 -
hdu2209 翻纸牌游戏-位运算bfs
hdu2209#include#include#include#includeusing namespace std;bool vis[1<<20];int path[1<<20],len;queueQ;int bfs(int x){ int X; if(!x) return 0; while(!Q.empty()) Q.pop(); Q.push(x);原创 2012-11-23 20:25:26 · 1052 阅读 · 0 评论