![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
MasterSPP
这个作者很懒,什么都没留下…
展开
-
滑雪
输入5 51 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9输出25原题链接:P1434 [SHOI2002]滑雪采用记忆化搜索以下是C代码#include <stdio.h>#include<stdlib.h>#include<math.h>int dx[4] = { 0,0,1,-1 };int dy[4] = { 1,-1,0,0 };int n, m.原创 2021-04-12 00:07:38 · 67 阅读 · 0 评论 -
数字金字塔—动态规划
思路:使用动态规划自底向上运算状态转换方程:f[i][j] = max{ f[i+1][j], f[i+1][j+1] } + a[i][j]如果题目数据中金字塔的行数太多,可以使用register,提高读写速度,也就是代码里注释掉的部分输入573 88 1 02 7 4 44 5 2 6 5输出30以下是C代码#include <stdio.h>#include<stdlib.h>#include<math.h>//#includ原创 2021-04-11 11:27:21 · 435 阅读 · 0 评论