码迷,mamicode.com
首页 >  
搜索关键字:简单dfs    ( 77个结果
POJ1979 Red and Black (简单DFS)
POJ1979DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile....
分类:其他好文   时间:2015-11-17 10:36:52    阅读次数:198
POJ1753【简单DFS算法】--翻棋盘(一步看不懂!!)
Flip GameTime Limit:1000MSMemory Limit:65536KTotal Submissions:35877Accepted:15658DescriptionFlip game is played on a rectangular 4x4 field with two-....
分类:编程语言   时间:2015-10-24 21:55:11    阅读次数:534
HDU 1312
题意:一个man站在@上,只能走上下左右四个方向,且不能踩到"#",问最多能猜到多少个".";简单dfs,既然只能走上下左右,那就把所有的方向全部遍历一遍;AC代码:#include #include #include const int dx[4]={1,0,-1,0};const int dy[...
分类:其他好文   时间:2015-10-23 18:47:44    阅读次数:212
【转】POJ-2362-Square:简单 DFS+剪枝
思路:首先将输入的各边长累加求和 即四边形周长sum, 后除4 即边长side,这样 通过DFS 搜索这些sticks能否组合成4根长度均为side 进而确定yes no。在此 就涉及到搜索顺序了-最优性剪枝: 不难理解 先搜索的小棒子 越长,组合构成side的方式就越少,搜索到结果的时间就越短。S...
分类:其他好文   时间:2015-09-14 20:51:56    阅读次数:145
ZOJ-3332(竞赛图中的哈密顿路径)
题意:n个点n*(n-1)/2条有向边,求每个点遍历一次的顺序,否则输出Impossible。思路:简单dfs遍历。以每个点为起点遍历,直到找出解;#include#include#includeusing namespace std;int t,n,m,temp,flag;int num[5050...
分类:其他好文   时间:2015-09-01 19:59:19    阅读次数:299
HDOJ1181(简单DFS)(练习使用STL)
#include#include#include#include#include#includeusing namespace std;const int MAX_N=105;vector words;map vis;queue que;bool dfs(int i,string word){ .....
分类:其他好文   时间:2015-08-28 13:11:42    阅读次数:130
poj 1321 棋盘问题 简单dfs
这么简单一道题目,想了这么久,还wa了一次,不可饶恕啊,越来越觉得自己笨了,dfs搜索都快不会写了。。。逻 辑混乱,一定得认真想题目,认真写代码: 代码: #include #include #include #include #include #include #include #include #include #define MAX 0x7fffffff using namespac...
分类:其他好文   时间:2015-08-26 20:12:55    阅读次数:143
nyoj 32 组合数【简单dfs】
组合数时间限制:3000ms | 内存限制:65535KB难度:3描述找出从自然数1、2、... 、n(0#includeint a[20],b[20];int n,m;void dfs(int cur,int pos){ int i; if(pos==m+1) { for(i=1;in) ret....
分类:其他好文   时间:2015-08-06 21:45:16    阅读次数:125
南阳27--水池数目(简单Dfs)
水池数目时间限制:3000 ms | 内存限制:65535 KB 难度:4描述南阳理工学院校园里有一些小河和一些湖泊,现在,我们把它们通一看成水池,假设有一张我们学校的某处的地图,这个地图上仅标识了此处是否是水池,现在,你的任务来了,请用计算机算出该地图中共有几个水池。输入第一行输入一个整数N,表示...
分类:其他好文   时间:2015-08-05 21:53:35    阅读次数:104
杭电 HDU 1312 Red and Black(超级简单dfs)
Red and Black Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12907    Accepted Submission(s): 7983 Problem Description There is a rect...
分类:其他好文   时间:2015-07-31 10:32:51    阅读次数:85
77条   上一页 1 2 3 4 5 6 ... 8 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!