Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页

2012年1月15日

摘要: 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 阅读(241) 评论(0) 推荐(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 阅读(281) 评论(0) 推荐(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 阅读(273) 评论(0) 推荐(0) 编辑

2012年1月14日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1241DFS我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=110; 4 const int dx[8]={0,1,1,1,0,-1,-1,-1}; 5 const int dy[8]={1,1,0,-1,-1,-1,0,1}; 6 char maze[N][N]; 7 int n,m,vis[N][N]; 8 void dfs(int x,int y) 9 {10 int d,nx,ny;11 vis[x][ 阅读全文
posted @ 2012-01-14 18:47 Qiuqiqiu 阅读(255) 评论(1) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1548我的代码 1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 using namespace std; 5 const int N=210; 6 int n,k[N],vis[N],dis[N]; 7 queue<int> q; 8 int bfs(int s,int e) 9 {10 if (s==e) return 0;11 while (!q.empty()) q.pop();1 阅读全文
posted @ 2012-01-14 17:53 Qiuqiqiu 阅读(141) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2660没用搜索,DP,二维背包我的代码 1 #include <stdio.h> 2 const int INF=10000000; 3 int f[25][1010]; 4 int a[25],b[25]; 5 int main() 6 { 7 int T; 8 scanf("%d",&T); 9 int n,k,w,i,j,j1,j2;10 while (T--)11 {12 scanf("%d%d",&n,&k);13 for 阅读全文
posted @ 2012-01-14 17:31 Qiuqiqiu 阅读(178) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3368模拟我的代码 1 #include <stdio.h> 2 const int dx[8]={0,1,1,1,0,-1,-1,-1}; 3 const int dy[8]={1,1,0,-1,-1,-1,0,1}; 4 char maze[10][10]; 5 int f(int xx,int yy) 6 { 7 int d,cnt=0; 8 for (d=0;d<8;d++) 9 {10 int c=0,x=xx,y=yy;11 do{12 ... 阅读全文
posted @ 2012-01-14 17:10 Qiuqiqiu 阅读(182) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2209BFS我的代码 1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 using namespace std; 5 const int maxa=1100000; 6 char s[25]; 7 int a,vis[maxa],dis[maxa],l; 8 queue<int> q; 9 int bfs(int x)10 {11 if (x==0) return 0;12 while ( 阅读全文
posted @ 2012-01-14 16:02 Qiuqiqiu 阅读(890) 评论(0) 推荐(0) 编辑

2012年1月13日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2514DFS我的代码 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 int a[10],cnt,ans[10]; 5 bool vis[10]; 6 bool conect(int x,int y) 7 { 8 if (x>y) {int t=x; x=y; y=t;} 9 switch (x)10 {11 case 1:return y==2 || y==3 || y==4;12 阅读全文
posted @ 2012-01-13 21:40 Qiuqiqiu 阅读(225) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1035不知道为什么这也是搜索题,分明就是模拟题我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=15; 4 const int dx[4]={0,1,0,-1}; 5 const int dy[4]={1,0,-1,0}; 6 char maze[N][N]; 7 int n,m,cnt,x,y; 8 int vis[N][N]; 9 int main()10 {11 int d,i;12 while (scan 阅读全文
posted @ 2012-01-13 17:46 Qiuqiqiu 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页