![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
记忆化搜索
limchiang
这个作者很懒,什么都没留下…
展开
-
POJ 1088 之二解
题目链接 题意:矩形滑雪区域中有各个点的高度,规定只能从高处滑向地处,问最长的滑行路线长度。 比如上面的区域最长路线为 25-24-23-...-3-2-1,长度为25,故应输出25。 解法一: DFS + 记忆化搜索 #include #include using namespace std; #define MAX 100 int arr[MAX + 5]原创 2013-02-02 21:39:43 · 215 阅读 · 0 评论 -
POJ 1159 Palindrome 之解法一 记忆化搜索
题目链接 题意:给定一个长度为N(3 )的字符串,只用插入字符这种操作,问要使其变成回文字符串,最少需多少步的插入? #include #include #include using namespace std; #define MAX 5000 #define min( x, y ) ( x < y ? x : y ) short int dp[MAX + 5][MAX + 5];原创 2013-02-18 13:37:06 · 220 阅读 · 0 评论