
DFS
蒟蒻的ACMer
2014界大学新生
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 1010 Tempter of the Bone dfs 奇偶剪枝
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 100396 Accepted Submission(s): 27198 Problem Description The dog原创 2016-04-05 15:28:16 · 1045 阅读 · 0 评论 -
POJ 1644 放苹果 递推 递归
放苹果 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28356 Accepted: 17939 Description 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。原创 2015-08-08 17:16:17 · 1093 阅读 · 0 评论 -
POJ 1321 棋盘问题 dfs
棋盘问题 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28461 Accepted: 14076 Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求原创 2015-08-08 17:13:00 · 576 阅读 · 0 评论 -
POJ 1011 Sticks dfs+剪枝
Sticks Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 129130 Accepted: 30264 Description George took sticks of the same length and cut them randomly until原创 2015-08-07 20:03:54 · 788 阅读 · 0 评论 -
YTU 2845: 编程题AB-卡片游戏 dfs
2845: 编程题AB-卡片游戏 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 19 Solved: 9 [Submit][Status][Web Board] Description 小明对数字的序列产生了兴趣: 现有许多张不同的数字卡片,用这若干张卡片能排列出很多序列,要求算出这若干张不同卡片的全排列总数,并按从小原创 2015-07-01 13:39:58 · 1355 阅读 · 0 评论 -
HDU 1312Red and Black dfs
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12117 Accepted Submission(s): 7543 Problem Description There is a原创 2015-06-30 13:18:31 · 1060 阅读 · 0 评论 -
poj 2488 A Knight's Journey
题意: 给你一个n*m的棋盘,问是否存在一条供马走的路能访问棋盘上所有的点如果存在输出字典序最小的路反之输出impossible 分析: 直接dfs就行,注意dx【】dy【】数组 因为要字典序输出路径 ACcode: #include #include #include #include #include #include #include using namespace原创 2017-03-29 15:53:15 · 357 阅读 · 0 评论 -
poj 3009 冰壶 dfs
题意: 给你一个n*m的图,进行冰壶游戏。 每次操作可以向上下左右四个方向投掷冰壶 当往一个方向投掷冰壶时,只有碰到墙壁才会停止(并击碎该墙壁) 如果没有墙壁,则冰壶回飞出地图,视为失败 给定起点和终点问是否能在10次操作内到达终点如果能输出最小步数否则输出-1 ACcode:///注意飞出图外的情况 #include #include #include #include u原创 2017-03-30 20:09:02 · 684 阅读 · 0 评论 -
poj 2531 DFS
题意: 给你n个点以及他们之间交互的值,问把这些点分为2堆,得到的最大值是多少 分析: 暴力dfs即可 ACcode: #include #include #include #include using namespace std; int a[25][25]; int vis[25]; int ans,n; void dfs(int x,int num){ vis[x]原创 2017-03-31 16:27:50 · 385 阅读 · 0 评论 -
poj 1416 dfs
提议: 给你2个数n,m m最大为6位数 把m数看成字符串分割成任意个数,这些数加起来不大于n 如果存在唯一的最接近n的解输出分割方案 如果不唯一输出rejected 如果不存在输出error ACcode: #include #include #include #include using namespace std; int n,m,len; int ans,time原创 2017-03-31 19:20:45 · 387 阅读 · 0 评论 -
YTU 2896/POJ 2192 Zipper dfs
2896: J--Zipper Time Limit: 1 Sec Memory Limit: 128 MB Submit: 25 Solved: 11 [Submit][Status][Web Board] Description Given three strings, you are to determine whether the third string c原创 2015-08-11 19:52:05 · 682 阅读 · 0 评论 -
YTU /蓝桥杯 2507: 李白打酒 水dfs
2507: 李白打酒 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 136 Solved: 82 [Submit][Status][Web Board] Description 话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒2斗。他边走边唱: 无事街上走,提壶去打酒。原创 2015-08-14 16:54:13 · 720 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem dfs
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 39621 Accepted Submission(s): 17457 Problem Description A ring is原创 2016-04-05 16:17:57 · 424 阅读 · 0 评论 -
HDU 1242 Rescue dfs
Rescue Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 3 Accepted Submission(s) : 1 Font: Times New Roman | Verdana | Georgia Font Size:原创 2016-04-05 17:25:50 · 492 阅读 · 0 评论 -
HDU 2952 Counting Sheep 简单dfs
Counting Sheep Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2657 Accepted Submission(s): 1763 Problem Description A while ago I h原创 2015-10-31 13:09:59 · 570 阅读 · 0 评论 -
poj 1426 Find The Multiple dfs
Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 25295 Accepted: 10413 Special Judge Description Given a positive integer n, write a p原创 2016-05-02 08:38:18 · 493 阅读 · 0 评论 -
POJ 2386 Lake Counting DFS
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 24735 Accepted: 12498 Description Due to recent rains, water has pooled in various places in原创 2015-10-23 20:39:11 · 605 阅读 · 0 评论 -
POJ 2965 The Pilots Brothers' refrigerator 枚举dfs
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21217 Accepted: 8196 Special Judge Description The game “The Pilots原创 2015-10-09 20:17:41 · 609 阅读 · 0 评论 -
POJ 1753 Filp Game dfs
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 35464 Accepted: 15504 Description Flip game is played on a rectangular 4x4 field with two-sided p原创 2015-10-09 19:17:57 · 580 阅读 · 0 评论 -
POJ 1270 Follwing Orders
poj 100题留影合照 Following Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4305 Accepted: 1726 Description Order is an important co原创 2015-09-24 18:53:52 · 519 阅读 · 0 评论 -
SDUT 1400 马的走法 简单dfs
马的走法 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 在一个4*5的棋盘上,马的初始位置坐标(纵 横)位置由键盘输入,求马能返回初始位置的所有不同走法的总数(马走过的位置不能重复,马走“日”字)。如果马的初始位置坐标超过棋盘的边界,则输出ERROR。例如初始位置为4 6,则输出ERR原创 2015-09-23 23:43:29 · 780 阅读 · 0 评论 -
uva 291 The house of santa claus DFS
The House Of Santa Claus In your childhood you most likely had to solve the riddle of the house of Santa Claus. Do you remember that the importance was on drawing the house in a stretch wi原创 2015-09-18 19:48:45 · 550 阅读 · 0 评论 -
山东省第一届ACM大学生程序设计竞赛 Balloons dfs搜索
Balloons Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 Both Saya and Kudo like balloons. One day, they heard that in the central park, there will be thousands of people fly bal原创 2016-03-31 20:01:17 · 921 阅读 · 0 评论