![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深搜dfs
不满de奶瓶
这个作者很懒,什么都没留下…
展开
-
枚举全排列
递归的使用,其中过程还要慢慢体会#include#includeint rec[20],num[20],n;int vis[20];void dfs(int dep){ //printf("s*******\n"); if(dep==n) { //printf("输出:"); for(int i=0;i<n;i++) printf("%d ",rec[i]);原创 2013-08-14 13:12:36 · 437 阅读 · 0 评论 -
从给的一些数中任意选出几个数相乘(组合数),求出所有和
#include#includeint count,a[550],v,end;void dfs(int n,int y) //组合数 { int i; int sum=1; if(n==count) { for(int j=0;j<count;j++) printf(" %d ",a[j]); puts(""); for(int j=0;原创 2013-08-27 21:24:50 · 1082 阅读 · 0 评论 -
L - Oil Deposits
DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a gri原创 2013-09-19 15:58:22 · 558 阅读 · 0 评论 -
N - Lake Counting
DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contai原创 2013-09-19 16:05:46 · 574 阅读 · 0 评论 -
F - Red and Black
DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent t原创 2013-09-19 15:19:49 · 775 阅读 · 0 评论