DFS
蒟蒻的ACMer
2014界大学新生
展开
-
HDU 1010 Tempter of the Bone dfs 奇偶剪枝
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 100396 Accepted Submission(s): 27198Problem DescriptionThe dog原创 2016-04-05 15:28:16 · 980 阅读 · 0 评论 -
POJ 1644 放苹果 递推 递归
放苹果Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28356 Accepted: 17939Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。原创 2015-08-08 17:16:17 · 1029 阅读 · 0 评论 -
POJ 1321 棋盘问题 dfs
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28461 Accepted: 14076Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求原创 2015-08-08 17:13:00 · 535 阅读 · 0 评论 -
POJ 1011 Sticks dfs+剪枝
SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 129130 Accepted: 30264DescriptionGeorge took sticks of the same length and cut them randomly until原创 2015-08-07 20:03:54 · 745 阅读 · 0 评论 -
YTU 2845: 编程题AB-卡片游戏 dfs
2845: 编程题AB-卡片游戏Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 19 Solved: 9[Submit][Status][Web Board]Description小明对数字的序列产生了兴趣:现有许多张不同的数字卡片,用这若干张卡片能排列出很多序列,要求算出这若干张不同卡片的全排列总数,并按从小原创 2015-07-01 13:39:58 · 1273 阅读 · 0 评论 -
HDU 1312Red and Black dfs
Red and BlackTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12117 Accepted Submission(s): 7543Problem DescriptionThere is a原创 2015-06-30 13:18:31 · 1010 阅读 · 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 · 285 阅读 · 0 评论 -
poj 3009 冰壶 dfs
题意:给你一个n*m的图,进行冰壶游戏。每次操作可以向上下左右四个方向投掷冰壶当往一个方向投掷冰壶时,只有碰到墙壁才会停止(并击碎该墙壁)如果没有墙壁,则冰壶回飞出地图,视为失败给定起点和终点问是否能在10次操作内到达终点如果能输出最小步数否则输出-1ACcode:///注意飞出图外的情况#include #include #include #include u原创 2017-03-30 20:09:02 · 608 阅读 · 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 · 343 阅读 · 0 评论 -
poj 1416 dfs
提议:给你2个数n,m m最大为6位数把m数看成字符串分割成任意个数,这些数加起来不大于n如果存在唯一的最接近n的解输出分割方案如果不唯一输出rejected如果不存在输出errorACcode:#include #include #include #include using namespace std;int n,m,len;int ans,time原创 2017-03-31 19:20:45 · 349 阅读 · 0 评论 -
YTU 2896/POJ 2192 Zipper dfs
2896: J--ZipperTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 25 Solved: 11[Submit][Status][Web Board]DescriptionGiven three strings, you are to determine whether the third string c原创 2015-08-11 19:52:05 · 630 阅读 · 0 评论 -
YTU /蓝桥杯 2507: 李白打酒 水dfs
2507: 李白打酒Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 136 Solved: 82[Submit][Status][Web Board]Description话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒2斗。他边走边唱: 无事街上走,提壶去打酒。原创 2015-08-14 16:54:13 · 662 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem dfs
Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 39621 Accepted Submission(s): 17457Problem DescriptionA ring is原创 2016-04-05 16:17:57 · 371 阅读 · 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) : 1Font: Times New Roman | Verdana | GeorgiaFont Size:原创 2016-04-05 17:25:50 · 443 阅读 · 0 评论 -
HDU 2952 Counting Sheep 简单dfs
Counting SheepTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2657 Accepted Submission(s): 1763Problem DescriptionA while ago I h原创 2015-10-31 13:09:59 · 523 阅读 · 0 评论 -
poj 1426 Find The Multiple dfs
Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 25295 Accepted: 10413 Special JudgeDescriptionGiven a positive integer n, write a p原创 2016-05-02 08:38:18 · 460 阅读 · 0 评论 -
POJ 2386 Lake Counting DFS
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24735 Accepted: 12498DescriptionDue to recent rains, water has pooled in various places in原创 2015-10-23 20:39:11 · 548 阅读 · 0 评论 -
POJ 2965 The Pilots Brothers' refrigerator 枚举dfs
The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21217 Accepted: 8196 Special JudgeDescriptionThe game “The Pilots原创 2015-10-09 20:17:41 · 534 阅读 · 0 评论 -
POJ 1753 Filp Game dfs
Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 35464 Accepted: 15504DescriptionFlip game is played on a rectangular 4x4 field with two-sided p原创 2015-10-09 19:17:57 · 537 阅读 · 0 评论 -
POJ 1270 Follwing Orders
poj 100题留影合照Following OrdersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4305 Accepted: 1726DescriptionOrder is an important co原创 2015-09-24 18:53:52 · 479 阅读 · 0 评论 -
SDUT 1400 马的走法 简单dfs
马的走法Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^题目描述在一个4*5的棋盘上,马的初始位置坐标(纵 横)位置由键盘输入,求马能返回初始位置的所有不同走法的总数(马走过的位置不能重复,马走“日”字)。如果马的初始位置坐标超过棋盘的边界,则输出ERROR。例如初始位置为4 6,则输出ERR原创 2015-09-23 23:43:29 · 719 阅读 · 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 · 513 阅读 · 0 评论 -
山东省第一届ACM大学生程序设计竞赛 Balloons dfs搜索
BalloonsTime 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 · 817 阅读 · 0 评论