深度优先搜索
FainTwinkle
这么好的故事,你可别演砸了。
展开
-
hdu1455 && poj1011 Sticks(深度优先搜索 DFS 经典剪枝 详解)
这道题在两个OJ上都有 POJ地址 http://poj.org/problem?id=1011 HDU地址 http://acm.hdu.edu.cn/showproblem.php?pid=1455 Sticks Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 12929原创 2015-08-12 15:26:14 · 576 阅读 · 0 评论 -
hdu 5305 Friends (dfs)
题目地址 http://acm.hdu.edu.cn/showproblem.php?pid=5305 Friends Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1626 Accepted Submission原创 2015-08-13 11:11:36 · 400 阅读 · 0 评论 -
POJ1190生日蛋糕题解
题目地址 http://poj.org/problem?id=1190 解题思路 这是一道深度优先搜索的题目,难点在于剪枝,题目中进行三次剪枝即可。 #include #include using namespace std; const int INF = 1 << 30; const int MAXM = 20 + 2; int minv[MAXM],mins[MAXM];//设置当前原创 2015-08-03 11:55:27 · 647 阅读 · 0 评论 -
hdu5802Windows 10(贪心+dfs)
题目大意 调节音量s到t,上升音量每秒只能上升1,下降音量每秒为2*x,x为上一次下降的音量,如果下降时休息或者上升音量则x置为1,音量最低为0 思路就是贪心的去选,每次下降到终点上的最近一点,或者终点下的一点,取得一个最小值就好。这题题意没弄明白,WA了好几发。 AC代码: #include #include #include #include using namespace std;原创 2016-08-04 23:39:00 · 877 阅读 · 0 评论 -
hdu5355Cake(dfs+set)
Problem Description There are m soda and today is their birthday. The 1-st soda has prepared n cakes with size 1,2,…,n. Now 1-st soda wants to divide the cakes into m parts so that the原创 2016-08-08 22:40:29 · 289 阅读 · 0 评论