原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1312代码:#include <iostream>#include<queue>using namespace std;char map[21][21];int row,col;int startX,startY;int dir[4][2]={{0,1},{0,-1},{1,0},{-1,0}};struct Node{ int x,y;};Node N,P; int num;void bfs(){ queue<Node> q; N.x=startX; N.y=s Read More
posted @ 2013-05-24 21:51 supersnow0622 Views(150) Comments(0) Diggs(0)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1253代码:#include <stdio.h>#include<queue>#include<memory.h>using namespace std;int map[51][51][51];int dir[6][3]={{1,0,0},{-1,0,0},{0,1,0},{0,-1,0},{0,0,1},{0,0,-1}};int x,y,z,t;struct Node{ int xx,yy,zz,usedtime;};Node N,P;bool judge;v Read More
posted @ 2013-05-24 21:47 supersnow0622 Views(201) Comments(0) Diggs(0)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1242代码:#include<iostream>#include<queue>#include<memory.h>using namespace std;int row,col;char map[201][201];int startX,startY,endX,endY;int dir[4][2]={{-1,0},{0,1},{1,0},{0,-1}};struct Node{ int x,y,count;};int visit[201][201];Node N, Read More
posted @ 2013-05-24 21:45 supersnow0622 Views(150) Comments(0) Diggs(0)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241代码:#include <iostream>using namespace std;int row,col;char map[101][101];int dir[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};void dfs(int i,int j){ int newr,newc; map[i][j]='*'; for(int k=0;k<8;k++) { newr=i+dir[k] Read More
posted @ 2013-05-24 21:43 supersnow0622 Views(128) Comments(0) Diggs(0)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1312代码:#include <iostream>using namespace std;int row,col;char map[101][101];int dir[8][2]={{-1,0},{1,0},{0,-1},{0,1}};int startX,startY;int count;void dfs(int i,int j){ int newr,newc; map[i][j]='#'; for(int k=0;k<8;k++) { newr=i+dir[k] Read More
posted @ 2013-05-24 21:41 supersnow0622 Views(161) Comments(0) Diggs(0)