
DFS
文章平均质量分 79
Low丶Coder
这个作者很懒,什么都没留下…
展开
-
POJ 1321——棋盘问题(DFS)
棋盘问题Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 50420 Accepted: 24427 Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋...原创 2017-09-07 14:53:29 · 260 阅读 · 0 评论 -
洛谷P1434 [SHOI2002]滑雪
题目描述Michael喜欢滑雪。这并不奇怪,因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道在一个区域中最长的滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子:1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 ...原创 2018-09-11 12:04:09 · 279 阅读 · 0 评论 -
PAT 1021 Deepest Root
1021 Deepest Root(25 分)A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the root that results in a hi...原创 2018-09-05 01:28:41 · 120 阅读 · 0 评论 -
洛谷 P1025 数的划分
题目描述将整数nn分成kk份,且每份不能为空,任意两个方案不相同(不考虑顺序)。例如:n=7n=7,k=3k=3,下面三种分法被认为是相同的。1,1,51,1,5;1,5,11,5,1;5,1,15,1,1.问有多少种不同的分法。输入输出格式输入格式: n,kn,k (6<n \le 2006<n≤200,2 \le k \le 62≤k≤6) ...原创 2018-08-28 12:39:18 · 497 阅读 · 0 评论 -
Codeforces743D Chloe and pleasant prizes(树形dp)
D. Chloe and pleasant prizesGenerous sponsors of the olympiad in which Chloe and Vladik took part allowed all the participants to choose a prize for them on their own. Christmas is coming, so sponso...原创 2018-08-23 15:59:34 · 419 阅读 · 2 评论 -
Codeforces1006E Military Problem
E. Military Problemtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn this problem you will have to help Berland army with organ...原创 2018-07-17 15:26:19 · 440 阅读 · 0 评论 -
EOJ3268 神奇怪兽在哪里
3268. 神奇怪兽在哪里Time limit per test: 2.0 secondsMemory limit: 256 megabytes熊猫先生最近在玩一款单机游戏。在游戏中,会有一张 n 行 m 列的地图(如样例中所示)。用 . 表示空地,用 * 表示怪兽,用 P 表示熊猫先生现在所在的位置。怪兽只有一个,所以由 * 组成的块一定是一个上下左右四连通块。游戏的规则是:熊猫先生要把怪兽「包...原创 2018-02-13 23:38:09 · 444 阅读 · 0 评论 -
POJ2386 Lake Counting简单dfs
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 36918 Accepted: 18352DescriptionDue to recent rains, water has pooled in various places in原创 2017-09-01 09:05:18 · 279 阅读 · 0 评论 -
HDU 2553 classic N皇后问题
N皇后问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25870 Accepted Submission(s): 11498 Problem Description在N*N的方格棋盘放置了N个皇后,使...原创 2017-09-07 16:12:54 · 229 阅读 · 0 评论 -
洛谷P1118 [USACO06FEB]数字三角形 Backward Digit Su(dfs剪枝)
题目描述FJ and his cows enjoy playing a mental game. They write down the numbers from 11 toN(1 \le N \le 10)N(1≤N≤10) in a certain order and then sum adjacent numbers to produce a new list with one fewe...原创 2018-09-11 20:27:11 · 281 阅读 · 0 评论