随笔分类 -  DP

摘要:http://poj.org/problem?id=2533#include#include#include#includeusing namespace std;int num[1000+100];int dp[1000+100];int main(){ int n; int i,j;... 阅读全文
posted @ 2015-01-25 23:24 sola94 阅读(159) 评论(0) 推荐(0)
摘要:Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given ... 阅读全文
posted @ 2014-12-08 21:20 sola94 阅读(155) 评论(0) 推荐(0)
摘要:Cheapest PalindromeTime Limit:2000MSMemory Limit:65536KTotal Submissions:5995Accepted:2922DescriptionKeeping track of all the cows can be a tricky tas... 阅读全文
posted @ 2014-11-11 20:47 sola94 阅读(119) 评论(0) 推荐(0)
摘要:Revenge of LIS IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1092Accepted Submission(s): 357Pr... 阅读全文
posted @ 2014-11-11 20:39 sola94 阅读(156) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=2392DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower o... 阅读全文
posted @ 2014-11-11 20:30 sola94 阅读(237) 评论(0) 推荐(0)
摘要:D -威威猫系列故事――打地鼠Time Limit:100MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 4540Description 威威猫最近不务正业,每天沉迷于游戏“打地鼠”。 每当朋友... 阅读全文
posted @ 2014-11-04 17:37 sola94 阅读(159) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1059题意: 有两个人一起收集石头 石头的重量有六种 每种都有一定的数量 现在两人想要将所有石头按重量来平分 问 可不可以做到思路:这题可以用多重背包解决把多重背包转化为01背包 如果dp[tot/2]==... 阅读全文
posted @ 2014-08-21 11:14 sola94 阅读(140) 评论(0) 推荐(0)
摘要:题意: n个装饰品 容量m的背包 每个装饰品 重wi 价值 di 求能装的最大价值思路:基础01背包#include#include#include#include#include#include#include#define mem(a,b) memset(a,b,sizeof(a))using ... 阅读全文
posted @ 2014-08-20 01:32 sola94 阅读(173) 评论(0) 推荐(0)
摘要:题意: 拉登有面值 1 2 5 的钱币 分别 n1 n2 n5 个 求出最大能连续组合到多大 思路: 想来想去都有bug 最后简单粗暴的一个一个来处理了#include#include#include#include#include#include#include#define mem... 阅读全文
posted @ 2014-08-16 00:41 sola94 阅读(124) 评论(0) 推荐(0)
摘要:装箱问题From admin描述 Description 有一个箱子容量为v(正整数,o≤v≤20000),同时有n个物品(o≤n≤30), 每个物品有一个体积 (正整数)。 要求从 n 个物品中,任取若干个装入箱内,使箱子的剩余空间为最小。输入格式 InputFormat第一行,一个... 阅读全文
posted @ 2014-08-10 21:25 sola94 阅读(294) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=1088DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组... 阅读全文
posted @ 2014-08-10 00:25 sola94 阅读(137) 评论(0) 推荐(0)
摘要:http://acm.fzu.edu.cn/problem.php?pid=2168Description部队中共有N个士兵,每个士兵有各自的能力指数Xi,在一次演练中,指挥部确定了M个需要防守的地点,按重要程度从低到高排序,依次以数字1到M标注每个地点的重要程度,指挥部将选择M个士兵依次进入指定地... 阅读全文
posted @ 2014-08-09 00:20 sola94 阅读(724) 评论(0) 推荐(0)