上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 41 下一页

poj 3211 Washing Clothes

摘要: // 题意 :夫妻两洗衣服,衣服有m种颜色,每种颜色又有若干件,每件衣服洗完需要特定的时间,要求每种颜色放在一起洗,洗完才能洗其他衣服。最后问洗完需要的最少时间// 将衣服按颜色分类 然后求出每种颜色衣服需要的最少时间,然后累加// 求每种颜色衣服的最少时间就是把洗衣服的时间尽量分成靠近的两部分 就用总时间的一半作为背包的容量 ,然后求该容量的最大值 每件的空间消耗和价值看成是一样的// 然后就是 0-1背包了#include #include #include #include #include #include using namespace std;#define MOD 1000000 阅读全文
posted @ 2013-07-15 08:57 江财小子 阅读(199) 评论(0) 推荐(0) 编辑

hdu 3535 AreYouBusy

摘要: // 混合背包// xiaoA想尽量多花时间做ACM,但老板要求他在T时间内做完n堆工作,每个工作耗时ac[i][j],// 幸福感ag[i][j],每堆工作有m[i]个工作,每堆工作都有一个性质,// 0表示至少要做里面的1个工作,// 1表示最多做里面的1个工作,// 2表示随意,做或不做都行。最后问在符合老板要求的情况下的最大幸福感,怎么都不符合要求就输出-1.// 0 可以看 hdu 3033 I love sneakers!// 1,2 情况就是普通背包了#include #include #include #include #include #include using names 阅读全文
posted @ 2013-07-14 19:36 江财小子 阅读(174) 评论(0) 推荐(0) 编辑

hdu 3496 Watch The Movie

摘要: 题意:题目给定N部电影,每部电影有时长和价值,要求看M部电影,并且时间控制在L以内,转化为背包问题,让我们在N件物品中找正好M件物品塞进容量L的包中,求最大的价值。// dp[i][j] 表示在容量为 i 的空间里面看 j部电影的最大收获价值// 背包#include #include #include #include #include #include using namespace std;#define MOD 1000000007#define maxn 110int dp[1010][maxn];int t[maxn],va[maxn];int main(){ int N,M... 阅读全文
posted @ 2013-07-14 10:24 江财小子 阅读(135) 评论(0) 推荐(0) 编辑

poj 2063 Investment

摘要: 题意:给定一个初始资金capital,然后给定d种投资方案,每种投资方案中有投资额value[i](是1000的倍数)和利息interest[i],每年的投资就可以拿到全部利息,然后累加起来继续投资利滚利。问经过year年后最多拥有多少资金?// 一年年的求最大利润就可以了// 每一年内都是完全背包// 这题的关键是value[i]都是1000的倍数 就可以把空间除以1000 了不然时间复杂度就高了好多#include #include #include #include #include #include using namespace std;#define MOD 1000000007# 阅读全文
posted @ 2013-07-14 09:20 江财小子 阅读(160) 评论(0) 推荐(0) 编辑

POJ 1276 Cash Machine

摘要: Cash MachineTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 23136Accepted: 8093DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k= 阅读全文
posted @ 2013-07-12 20:30 江财小子 阅读(317) 评论(0) 推荐(0) 编辑

poj 2373 Dividing the Path

摘要: Dividing the PathTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 2858Accepted: 1064DescriptionFarmer John's cows have discovered that the clover growing along the ridge of the hill in his field is particularly good. To keep the clover watered, Farmer John is installing water sprinklers 阅读全文
posted @ 2013-07-12 19:34 江财小子 阅读(621) 评论(0) 推荐(0) 编辑

poj 1631 Bridging signals

摘要: Bridging signalsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 9178Accepted: 5006Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connect 阅读全文
posted @ 2013-07-12 10:38 江财小子 阅读(179) 评论(0) 推荐(0) 编辑

hdu 1494 跑跑卡丁车

摘要: 跑跑卡丁车Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1806Accepted Submission(s): 589 Problem Description跑跑卡丁车是时下一款流行的网络休闲游戏,你可以在这虚拟的世界里体验驾驶的乐趣。这款游戏的特别之处是你可以通过漂移来获得一种 加速卡,用这种加速卡可以在有限的时间里提高你的速度。为了使问题简单化,我们假设一个赛道分为L段,并且给你通过每段赛道的普通耗时Ai和用加速卡的耗时Bi。加速卡的获 阅读全文
posted @ 2013-07-12 09:47 江财小子 阅读(370) 评论(0) 推荐(0) 编辑

poj 1837 Balance

摘要: BalanceTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 8754Accepted: 5320DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm's length is 15. S 阅读全文
posted @ 2013-07-11 17:23 江财小子 阅读(141) 评论(0) 推荐(0) 编辑

poj 1179 Polygon

摘要: PolygonTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 4464Accepted: 1859DescriptionPolygon is a game for one player that starts on a polygon with N vertices, like the one in Figure 1, where N=4. Each vertex is labelled with an integer and each edge is labelled with either the symbol + (add 阅读全文
posted @ 2013-07-11 10:35 江财小子 阅读(349) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 41 下一页