
搜索-深度优先搜索
你迎哥哥
这个作者很懒,什么都没留下…
展开
-
HDU 1241 Oil Deposits
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241Oil DepositsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12731 Accepted Submiss原创 2014-11-09 23:00:00 · 430 阅读 · 0 评论 -
HDU 1426 Sudoku Killer
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1426Sudoku KillerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4385 Accepted Submiss原创 2015-01-22 19:07:30 · 438 阅读 · 0 评论 -
HDU 4499 Cannon
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4499Cannon Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 518 Accepted Submission(s):原创 2015-03-09 13:49:03 · 514 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 79233 Accepted原创 2015-03-11 22:39:00 · 400 阅读 · 0 评论 -
HDU 1584 蜘蛛牌
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1584蜘蛛牌Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1808 Accepted Submission(s): 7原创 2015-04-11 16:41:39 · 580 阅读 · 0 评论 -
HDU 2181 哈密顿绕行世界问题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2181哈密顿绕行世界问题Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1543 Accepted Submission(原创 2015-04-11 16:48:37 · 357 阅读 · 0 评论 -
HDU 1501 Zipper
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1501ZipperTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7439 Accepted Submission(s):原创 2015-04-11 16:30:55 · 364 阅读 · 0 评论 -
HDU 2614 Beat
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2614BeatTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 874 Accepted Submission(s): 54原创 2015-04-11 16:58:56 · 357 阅读 · 0 评论 -
HDU 1539 Shredding Company
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1539Shredding CompanyTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 415 Accepted Subm原创 2015-04-11 16:38:49 · 451 阅读 · 0 评论 -
HDU 2610 Sequence one
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2610Sequence oneTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 489 Accepted Submissio原创 2015-04-11 16:53:40 · 425 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1016Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 31223 Accepted S原创 2015-04-11 16:20:41 · 374 阅读 · 0 评论 -
HDU 2611 Sequence two
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2611Sequence twoTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 532 Accepted Submissio原创 2015-04-11 16:55:31 · 511 阅读 · 0 评论 -
HDU 1045 Fire Net
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1045Fire NetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6848 Accepted Submission(s原创 2015-01-20 19:53:00 · 434 阅读 · 0 评论 -
HDU 1572 下沙小面的(2) (DFS)
然后这道题可以用DFS暴力#includeusing namespace std;const int maxn=35;int vis[maxn],n,k,Map[maxn][maxn],num[maxn],mark[maxn],cnt;int ans;void dfs(int d,int now,int dist){ if(d==cnt) { ans原创 2015-08-27 15:20:32 · 483 阅读 · 0 评论 -
HDU 1258 Sum It Up
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1258Sum It UpTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4352 Accepted Submission(原创 2015-01-21 22:37:18 · 457 阅读 · 0 评论 -
HDU 1224 Free DIY Tour
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1224Free DIY TourTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4367 Accepted Submiss原创 2015-01-20 10:29:51 · 523 阅读 · 0 评论 -
HDU 1175 连连看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1175连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21071 Accepted Submission(s):原创 2015-01-20 10:28:42 · 1186 阅读 · 0 评论 -
HDU 1312 Red and Black
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1312原创 2014-11-09 23:32:58 · 469 阅读 · 0 评论 -
HDU 1518 Square
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1518原创 2014-11-10 22:14:17 · 467 阅读 · 0 评论 -
HDU 1455 Sticks
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1455原创 2014-11-10 23:45:09 · 548 阅读 · 0 评论 -
HDU 1198 Farm Irrigation
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1198Farm IrrigationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6023 Accepted Submi原创 2014-11-11 23:33:13 · 389 阅读 · 0 评论 -
HDU 1881 毕业bg
题目链接:毕业bgTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4988 Accepted Submission(s): 1860Problem Description每年毕业的季节都会有大量毕业生发起狂原创 2014-11-12 22:09:29 · 404 阅读 · 0 评论 -
HDU 1728 逃离迷宫
逃离迷宫Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15996 Accepted Submission(s): 3897Problem Description 给定一个m × n (m行, n列)的迷宫,原创 2014-11-13 10:15:26 · 509 阅读 · 0 评论 -
HDU 1232 畅通工程
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1232原创 2014-11-12 21:37:51 · 389 阅读 · 0 评论 -
HDU 1181 变形课
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1181原创 2014-11-11 22:56:00 · 430 阅读 · 0 评论 -
HDU 2553 N皇后问题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553原创 2014-11-12 22:40:47 · 400 阅读 · 0 评论 -
康拓展开+康拓逆展开(构造按字典序排序的第n个排列)
康拓展开模板#includeusing namespace std;int fac[] = {1,1,2,6,24,120,720,5040,40320}; //i的阶乘为fac[i]/* 康托展开. {1...n}的全排列由小到大有序,s[]为第几个数 */int KT(int n, int s[]){ int i, j, t, sum; sum =原创 2015-01-29 19:45:31 · 923 阅读 · 0 评论 -
DFS之枚举排列组合
枚举可重复排列的模板#includeusing namespace std;int n,m,ans[15];int a[15];//待排列的数存储在此bool vis[15];void dfs(int cnt)//按字典序输出n个数选m个数的所有排列{ if(cnt==m) { for(int i=0;i<m;i++) cout<<ans[i]<<"原创 2015-01-29 19:41:13 · 3400 阅读 · 0 评论 -
HDU 1372 Knight Moves
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1372Knight MovesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7400 Accepted Submission原创 2015-01-31 13:40:13 · 437 阅读 · 0 评论 -
HDU 1242 Rescue
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1242RescueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17870 Accepted Submission(s)原创 2015-01-20 16:49:54 · 402 阅读 · 0 评论 -
简单谈谈实现递归暴力枚举
简单谈一谈如何用递归实现暴力枚举。 下面先看到一个例子。 袋子里有2红3绿5黄球,随机从中摸出8个,打印显示所有组合。 暴力枚举,其实就是实现一颗搜索树。 那很显然这颗搜索树的层数是8层,因为只要摸8个就行了。每个节点拓展出去的儿子节点很显然是10个,因为每次都有10种选择。 那很显然。8层是递归出口。10个是每层要枚举的分支。所以可以写出如下代码。char s[]="gggrryyyyy原创 2017-03-21 01:08:18 · 4187 阅读 · 4 评论