摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1240bfs我的代码 1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 using namespace std; 5 const int N=15; 6 const int dx[6]={1,0,0,-1,0,0}; 7 const int dy[6]={0,1,0,0,-1,0}; 8 const int dz[6]={0,0,1,0,0,-1}; 9 struct coor10 {11 int x
阅读全文
posted @ 2012-01-15 20:31
Qiuqiqiu
阅读(181)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2258DFS我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=25; 4 const int dx[4]={0,1,0,-1}; 5 const int dy[4]={1,0,-1,0}; 6 char maze[N][N]; 7 bool vis[N][N]; 8 int m,n,cnt; 9 void dfs1(int x,int y,char c)10 {11 vis[x][y]=1; cnt++;12 i
阅读全文
posted @ 2012-01-15 18:59
Qiuqiqiu
阅读(243)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1572生存排列枚举我的代码 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 const int N=40,INF=10000000; 5 int a[N][N],p[10],b[10]; 6 int main() 7 { 8 int n,k,ans,s,i,j; 9 while (scanf("%d",&n),n)10 {11 ans=INF;12 for (i=0;..
阅读全文
posted @ 2012-01-15 14:27
Qiuqiqiu
阅读(282)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1547dfs我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=210; 4 const int dx[6]={0,1,1,0,-1,-1}; 5 const int dy[6]={2,1,-1,-2,-1,1}; 6 char maze[N][N]; 7 int m,n,ans; 8 void dfs1(int x,int y,char c) 9 {10 maze[x][y]=0; ans++;11 int d,
阅读全文
posted @ 2012-01-15 14:06
Qiuqiqiu
阅读(275)
推荐(0)
编辑