摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1045DFS我的代码 1 #include <stdio.h> 2 const int N=5; 3 char maze[N][N]; 4 int vis[N][N]; 5 int n,ans; 6 int ok(int x,int y) 7 { 8 if (maze[x][y]=='X') return 0; 9 int i;10 for (i=x+1;i<n && maze[i][y]!='X';i++)11 if (vis[i][y])
阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3713BFS我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=10000; 4 const int dx[4]={0,1,0,-1}; 5 const int dy[4]={-1,0,1,0}; 6 const char dd[5]="LDRU"; 7 int maze1[10][10],maze2[10][10]; 8 int vis[N],dir[N],fa[N],q[N],dir2[N]
阅读全文