动态规划
文章平均质量分 50
wchyumo2009
这个作者很懒,什么都没留下…
展开
-
杭电hdu 2059 龟兔赛跑 动态规划
http://acm.hdu.edu.cn/showproblem.php?pid=2059学了那么久的算法,结果动态规划的小题还是给卡了,看来还是要做动态规划的题啊,不练就是不行啊,参考代码:#include #include using namespace std;#include int main(){// freopen("input.txt", "r", std原创 2012-04-06 08:12:03 · 3037 阅读 · 0 评论 -
南阳理工oj 10 skiing 动态规划
http://acm.nyist.net/JudgeOnline/problem.php?pid=10简单的动态规划题,在深搜时需要记录每一个的状态,然后直接就调用了,省了很多时间。#include #include #define MAX 101int height[MAX][MAX];int tmp[MAX][MAX];int r,c;int dir[4][2]原创 2012-04-18 22:29:56 · 1564 阅读 · 0 评论 -
杭电hdu 1231 最大连续子序列 dp
http://acm.hdu.edu.cn/showproblem.php?pid=1231动态转移方程:f(n) = max(a, a+f(n-1));//hdu_1231#include int max(int a, int b){ return a > b ? a : b;}int main(){// freopen("input.txt","r", stdin)原创 2012-05-03 19:06:45 · 1073 阅读 · 0 评论 -
杭电hdu 1074 Doing Homework dp
http://acm.hdu.edu.cn/showproblem.php?pid=1074动态压缩dp,感觉还是没有怎么懂,主要用的是二进制的位运算。有待于研究。//动态压缩dp#include #include #include using namespace std;typedef struct _homework{ char name[102]; int dea原创 2012-05-12 11:18:43 · 1136 阅读 · 0 评论