会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
algorithms爱好者
博客园
首页
新随笔
联系
管理
订阅
04 2013 档案
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)
学习
摘要:C语言,数据结构,算法!!!
阅读全文
posted @
2013-04-18 18:04
algorithms爱好者
阅读(90)
评论(0)
推荐(0)
POJ2524(并查集)
摘要:#include <iostream>#define M 50005using namespace std;int n,m,fa[M];int find_fa(int x){ while(fa[x]!=x) { x=fa[x]; } return x;}void merg(int x,int y){ if(find_fa(x)!=find_fa(y)) { fa[find_fa(x)]=find_fa(y); }}int main(){ int i,a,b,sum,si=...
阅读全文
posted @
2013-04-18 14:05
algorithms爱好者
阅读(94)
评论(0)
推荐(0)
POJ1723
摘要:#include <iostream>#include<algorithm>using namespace std;void qsort(int arr[],int sta,int end){ if(sta<end) { int x,i=sta,j=end; x=arr[i]; while(i<j) { while(arr[j]>x&&i<j) { j--; } if(i<j) { arr[i++]=arr[j]; } while(arr[i]<=x&&i<j) { i++; } if(i<
阅读全文
posted @
2013-04-14 14:52
algorithms爱好者
阅读(110)
评论(0)
推荐(0)
POJ2342
摘要:#include<iostream>using namespace std;const int M = 6010;int V[M][2];int fa[M];int n;int Max(int a,int b){ return a>b?a:b;}void calculator(int node){ int i; for(i=1;i<=n;i++) { if(fa[i]==node) { calculator(i); V[node][1]+=V[...
阅读全文
posted @
2013-04-08 11:46
algorithms爱好者
阅读(107)
评论(0)
推荐(0)
公告