
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 · 696 阅读 · 2 评论 -
hdu1242 Rescue
hdu1242 Rescue 广搜的模板 弄明白之后就觉得……太简单了 #include #include using 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 · 852 阅读 · 0 评论 -
hdu1072 nightmare
hdu1072 nightmare ……跟hdu1242有些不同 走过的路可以返回 所以不要标记,换炸弹的倒计时限制队列的增长 #include #include #include using 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 · 731 阅读 · 0 评论 -
hdu1582AC again-bfs
#include using 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 · 824 阅读 · 0 评论 -
hdu2102 双层bfs
hdu2102 当传送的目的地是墙或者仍是传送机的时候就不要去了,把他当做墙. #include #include using 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 · 2245 阅读 · 1 评论 -
hdu2209 翻纸牌游戏-位运算bfs
hdu2209 #include #include #include #include using 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 · 1083 阅读 · 0 评论