会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
algorithms爱好者
博客园
首页
新随笔
联系
管理
订阅
随笔分类 -
DFS
POJ1111
摘要:#include <iostream>#include <string.h>using namespace std;char grid[25][25];int vis[25][25];int n,m,x,y,tol;void DFS(int a,int b){ vis[a][b]=1; if(b+1<=m)//右面 { if(b+1==m) { tol++; } else { if(gri...
阅读全文
posted @
2013-05-08 22:24
algorithms爱好者
阅读(101)
评论(0)
推荐(0)
POJ1321
摘要:看了别人代码后才想明白的。还得多加练习搜索题!#include <iostream>using namespace std;char Map[9][9];bool place_c[9];int number_p;int tol;int n,k;bool can_place(int i,int j){ return !place_c[j]&&Map[i][j]=='#';}void DFS(int i){ if(number_p==k) { tol++; return; } if(i>=n) return; int j...
阅读全文
posted @
2013-04-19 13:54
algorithms爱好者
阅读(83)
评论(0)
推荐(0)
公告