//目录
摘要: 题目链接:http://noi.openjudge.cn/ch0206/4978/ 二维费用背包 在最后找还剩多少体力的时候,直接找到第二维,当结果 f[n][i] == f[n][m] 时,就说明已经到达上限了 剩下的体力 = m-i; http://paste.ubuntu.com/234111 阅读全文
posted @ 2016-11-02 18:02 小草的大树梦 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://noi.openjudge.cn/ch0206/7627/ 题目讲的二分其实是一个误导, d(i,j),表示当前最优策略时,最坏的情况下: 有 J 个鸡蛋,I 个可以怀疑的楼层,那么在这I个可以怀疑的楼层中,挑一楼来测,取最优值,然而情况有两种,要么碎了 d(k-1,i-1) 阅读全文
posted @ 2016-11-02 18:01 小草的大树梦 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://noi.openjudge.cn/ch0206/666/ 和ural 1114题意类似,但是有顺序,5,1,1和1,5,1是同一种序列。不能直接枚举 d(i,j) 前 i 个盘子,用掉 j 个苹果,3重循环。 这里是方案是: m 个苹果,n 个盘子,只有两种情况,要么有空,要 阅读全文
posted @ 2016-11-02 17:59 小草的大树梦 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://noi.openjudge.cn/ch0206/9265/ 题意:从自然数1到N中不取相邻2数地取走任意个数,问方案数。 解法:f[i][1]表示在前i个数中选了第i个的方案数,f[i][0]表示没有选第i个。f[i][1]=f[i-1][0]; f[i][0]=f[i-1] 阅读全文
posted @ 2016-11-02 17:49 小草的大树梦 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://noi.openjudge.cn/ch0206/4982/ 深搜很好写。 DP:O(n) d[i] 为走 I 不的方案数, l[i],r[i],u[i]为第一步走 左,右,上,共走 i 步的方案数。(u[i]= d[i-1]) d[i] = l[i] + r[i] + u[i 阅读全文
posted @ 2016-11-02 17:48 小草的大树梦 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://noi.openjudge.cn/ch0206/8462/ 相邻的两个不能同时取, d[i] = max(d[i-1],d[i-2]+a[i]); http://paste.ubuntu.com/23406668/ 阅读全文
posted @ 2016-11-02 17:47 小草的大树梦 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://noi.openjudge.cn/ch0206/1944/ 根据第一天吃的个数递推,发现这个递推关系很像斐波那契数列。 http://paste.ubuntu.com/23402479/ 阅读全文
posted @ 2016-11-02 17:45 小草的大树梦 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://noi.openjudge.cn/ch0206/6049/ 6049:买书 6049:买书 查看 提交 统计 提问 查看 提交 统计 提问 小明手里有n元钱全部用来买书,书的价格为10元,20元,50元,100元。 问小明有多少种买书方案?(每种书可购买多本) 和noi29 阅读全文
posted @ 2016-11-02 17:43 小草的大树梦 阅读(582) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://noi.openjudge.cn/ch0206/2985/ 2985:数字组合 查看 提交 统计 提问 总时间限制: 1000ms 内存限制: 65536kB 描述 有n个正整数,找出其中和为t(t也是正整数)的可能的组合方式。如: n=5,5个数分别为1,2,3,4,5, 阅读全文
posted @ 2016-11-02 17:40 小草的大树梦 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 题目链接: 很像上一题,加上自己本身,选最优值。 http://noi.openjudge.cn/ch0206/2728/ http://paste.ubuntu.com/23402493/ 阅读全文
posted @ 2016-11-02 17:38 小草的大树梦 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://noi.openjudge.cn/ch0206/2718/ 右上角的方案数 f(m,n) = f(m-1,n) + f(m,n-1); http://paste.ubuntu.com/23402490/ 阅读全文
posted @ 2016-11-02 17:37 小草的大树梦 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://noi.openjudge.cn/ch0206/4977/ LIS http://paste.ubuntu.com/23406594/ 阅读全文
posted @ 2016-11-02 17:35 小草的大树梦 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://noi.openjudge.cn/ch0206/8780/ LDS 也可以转换为LIS 阅读全文
posted @ 2016-11-02 17:33 小草的大树梦 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://noi.openjudge.cn/ch0206/1996/ LIS,LDS 正着做最长递增子序列,反着做最长递减子序列。 http://paste.ubuntu.com/23402475/ 阅读全文
posted @ 2016-11-02 17:31 小草的大树梦 阅读(240) 评论(0) 推荐(0) 编辑