背包
文章平均质量分 82
mrcoderrev
C
展开
-
HDU 3033 I love sneakers!(分组背包->每组至少取一个)
I love sneakers!Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAfter months of hard working, Iserlohn finally wins awesome amou原创 2016-09-25 17:13:55 · 231 阅读 · 0 评论 -
L3-001. 凑零钱 (01背包)@
L3-001. 凑零钱时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越韩梅梅喜欢满宇宙到处逛街。现在她逛到了一家火星店里,发现这家店有个特别的规矩:你可以用任何星球的硬币付钱,但是绝不找零,当然也不能原创 2017-03-28 11:46:13 · 701 阅读 · 0 评论 -
HDU 3466 Proud Merchants(排序的01背包)@
Proud MerchantsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 5525 Accepted Submission(s): 2327Problem DescriptionRecently,原创 2016-10-26 21:47:56 · 542 阅读 · 0 评论 -
uva 674(完全背包求方法数)@
Description#include #include #include #include #include using namespace std;const int N = 100000;int k[N], dp[N];int main(){ int v[]={1,5,10,25,50}; int n;原创 2016-10-26 21:48:10 · 296 阅读 · 0 评论 -
poj 1837 Balance (背包)
Gigel 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. Some h原创 2017-03-13 12:09:07 · 156 阅读 · 0 评论 -
zzu 10452: "分"数(控制数量的01背包)@
10452: "分"数Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 217 Solved: 26[Submit][Status][Web Board]Description有一个由偶数个正整数组成的无序数组,现在小D想:怎样把这个含有偶数(2*n)个数的数组分为两个元素个数相等的数组,并使得两个字数组的和最接近?原创 2017-02-27 15:30:31 · 282 阅读 · 0 评论 -
POJ 3211 Washing Clothes(01背包)@
Washing ClothesTime Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionDearboy was so busy recently that now he has piles of clothes to原创 2017-03-02 21:06:58 · 217 阅读 · 0 评论 -
POJ 3260 The Fewest Coins(多重背包+完全背包—>交易数量最小)@
The Fewest CoinsTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionFarmer John has gone to town to buy some farm supplies. Being a原创 2016-10-26 21:49:07 · 461 阅读 · 0 评论 -
POJ - 1742 Coins(多重背包)@
CoinsTime Limit: 3000MS Memory Limit: 30000KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionPeople in Silverland use coins.They have coins of value A1,A2,原创 2016-10-25 19:44:39 · 251 阅读 · 0 评论 -
zzuli 1880: 蛤玮点菜(状态压缩的超大背包处理方法)@
1880: 蛤玮点菜Time Limit: 2 Sec Memory Limit: 128 MBSubmit: 321 Solved: 32SubmitStatusWeb BoardDescription在我们下饭店的时候蛤玮经常负责点菜,今天饭店搞活动,当总价格大于等于X时可以减去Y的优惠,注意如果总价是2X也仅减去一倍Y.蛤玮非常了解菜品也了解大家,他知道每原创 2017-05-06 10:33:28 · 322 阅读 · 0 评论 -
HihoCoder - 1364 奖券兑换 (01背包转多重背包 二进制优化)@
小Hi在游乐园中获得了M张奖券,这些奖券可以用来兑换奖品。可供兑换的奖品一共有N件。第i件奖品需要Wi张奖券才能兑换到,其价值是Pi。 小Hi使用不超过M张奖券所能兑换到的最大奖品总价值是多少?Input第一行两个整数N,M。 接下来N行,每行两个整数Wi,Pi。 对于 50%的数据: 1≤N,M≤1000 对于 100%的数据: 1≤N,M≤105,1≤P原创 2017-05-22 17:35:27 · 381 阅读 · 0 评论 -
CodeForces - 808E Selling Souvenirs(价值大重量小的01背包)@
Selling Souvenirs CodeForces - 808E 题意:01背包,重量为1-3,价值1-1e9解:按照重量1-3分类,价值贪心从大到小排序,遍历重量记录中间过程最优价值的1-2-3物品使用个数#include #include using namespace std;typedef long long LL;const in原创 2017-05-22 19:59:16 · 407 阅读 · 0 评论 -
light oj 1017 - Brush (III)(背包->直线覆盖点的最大数量)
1017 - Brush (III) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBSamir returned home from the contest and got angry after seei原创 2016-10-01 11:53:28 · 203 阅读 · 0 评论 -
hdu 6007 Mr. Panda and Crystal(最短路+完全背包)
Mr. Panda and CrystalTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 446 Accepted Submission(s): 143Problem DescriptionLong l原创 2017-09-27 19:49:49 · 309 阅读 · 0 评论 -
hdu 3535 AreYouBusy(分组背包->总和考察)
AreYouBusyTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionHappy New Term! As having become a junior, xiaoA recognizes that the原创 2016-09-26 12:29:39 · 225 阅读 · 0 评论 -
POJ 1837 Balance(01背包求方案数)
BalanceTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionGigel has a strange "balance" and he wants to poise it. Actually, the devic原创 2016-09-25 20:04:56 · 242 阅读 · 0 评论 -
hdu 1712 ACboy needs your help (分组背包)
分组Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionACboy has N courses this term, and he plans to spend at most M days on study.O原创 2016-09-25 16:00:05 · 148 阅读 · 0 评论 -
light oj 1231 - Coin Change (I)(多重背包)
1231 - Coin Change (I) PDF (English)StatisticsForumTime Limit: 1 second(s)Memory Limit: 32 MBIn a strange shop there are n types of coins of value A1,原创 2017-08-21 16:45:32 · 467 阅读 · 0 评论 -
hdu 5534 Partial Tree(完全背包)
Partial TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1451 Accepted Submission(s): 724Problem DescriptionIn mathemati原创 2017-08-21 15:44:52 · 176 阅读 · 0 评论 -
HDU - 6083 度度熊的午饭时光 (记录路径的01背包)
度度熊最期待每天的午饭时光,因为早饭菜品清淡,晚饭减肥不敢吃太多(胖纸的忧伤T.T)。 百度食堂的午餐超级丰富,祖国各大菜系应有尽有,度度熊在每个窗口都有爱吃的菜品,而且他还为喜爱的菜品打了分,吃货的情怀呀(>.但是,好吃的饭菜总是很贵,每天的午饭预算有限,请帮度度熊算一算,怎样打饭才能买到的最好吃的饭菜?(不超过预算、不重样、午餐等分最高的情况下,选择菜品序号加和最小,加和相等时原创 2017-08-08 09:54:31 · 320 阅读 · 0 评论 -
HDU 2063 Investment(多次完全背包)
InvestmentTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionJohn never knew he had a grand-uncle, until he received the notary's let原创 2016-10-26 21:51:03 · 520 阅读 · 0 评论 -
POJ - 2392 Space Elevator(多重背包)
Space ElevatorTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionThe cows are going to space! They plan to achieve orb原创 2016-10-25 19:45:56 · 237 阅读 · 0 评论 -
POJ - 3181 Dollar Dayz(多重背包)
Dollar DayzTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionFarmer John goes to Dollar Days at The Cow Store and dis原创 2016-10-25 19:44:56 · 203 阅读 · 0 评论 -
HDU 4815
Little Tiger vs. Deep MonkeyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 2140 Accepted Submission(s): 748Problem Description原创 2016-08-26 10:28:56 · 256 阅读 · 0 评论 -
NYOJ 题目546 Divideing Jewels
Divideing Jewels时间限制:1000 ms | 内存限制:65535 KB难度:4描述Mary and Rose own a collection of jewells. They want to split the collection among themselves so that both receive an equal share of the j原创 2016-05-18 14:42:04 · 284 阅读 · 0 评论 -
hdu 2955 Robberies
The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrative原创 2016-05-14 21:24:51 · 334 阅读 · 0 评论 -
hdu 2159 FATE
二维背包问题, 利用背包的最优思想逐步取最优感觉还是对背包的思维不熟练#include #include using namespace std;#define N 110int dp[N][N];struct node{ int jy, rn;}p[N];int main(){ int n, m, k, s; wh原创 2016-05-14 17:18:53 · 226 阅读 · 0 评论 -
NYOJ 311 完全背包
完全背包时间限制:3000 ms | 内存限制:65535 KB难度:4描述直接说题意,完全背包定义有N种物品和一个容量为V的背包,每种物品都有无限件可用。第i种物品的体积是c,价值是w。求解将哪些物品装入背包可使这些物品的体积总和不超过背包容量,且价值总和最大。本题要求是背包恰好装满背包时,求出最大价值总和是多少。如果不能恰好装满背包,输出NO原创 2016-05-26 09:39:31 · 212 阅读 · 0 评论 -
POJ - 2184 Cow Exhibition(变种01背包...)
Cow ExhibitionTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmit StatusDescription"Fat and docile, big and dumb, they look so stupid, t原创 2016-10-26 21:46:34 · 374 阅读 · 0 评论 -
hdu 2546 (01背包)
饭卡Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23721 Accepted Submission(s): 8339Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即原创 2016-10-26 21:47:05 · 192 阅读 · 0 评论 -
UVA 624 CD(打印路径的01背包)
Root 624 - CDTime limit: 3.000 seconds类似于搜索中的打印路径,用一个数组标记,,,不好想#include #include #include #include #include using namespace std;const int N = 1000;原创 2016-10-26 21:47:22 · 251 阅读 · 0 评论 -
HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包转01背包)
悼念512汶川大地震遇难同胞――珍惜现在,感恩生活Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你原创 2016-10-26 21:50:56 · 270 阅读 · 0 评论 -
HDU 1114(多重背包)
多重Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionBefore ACM can do anything, a budget must be prepared and the necessary fina原创 2016-10-26 21:50:38 · 274 阅读 · 0 评论 -
poj 1276 Cash Machine(多重背包求最大容量)
Cash MachineTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionA Bank plans to install a machine for cash withdrawal. The machine is原创 2016-10-26 21:50:05 · 234 阅读 · 0 评论 -
uva147 Dollars(完全背包方案)
DollarsTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 147 uDebugAppoint description: System Crawler (Sep 21, 2016 8:33:48 PM)De原创 2016-10-26 21:49:25 · 407 阅读 · 0 评论 -
poj 1787 Charlie's Change(打印路径的多重背包 ->交易数量最大化)
Charlie's ChangeTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluSubmit Status Practice _Appoint description: System Crawler (Sep 19, 2016 8:51:38 PM)De原创 2016-10-26 21:48:44 · 319 阅读 · 0 评论 -
hdu 2126 Buy the souvenirs(01背包求最大容量方法数)
Buy the souvenirsTime Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2102 Accepted Submission(s): 795Problem DescriptionWhen the原创 2016-10-26 21:48:27 · 277 阅读 · 0 评论 -
hdu 2955 Robberies(01背包)
RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 21042 Accepted Submission(s): 7805Problem DescriptionThe aspiring Ro原创 2016-10-26 21:47:45 · 242 阅读 · 0 评论 -
hdu 2639 Bone Collector II(01背包的第k值)
Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4226 Accepted Submission(s): 2202Problem DescriptionThe titl原创 2016-10-26 21:47:28 · 214 阅读 · 0 评论 -
NYOJ 49 开心的小明
开心的小明时间限制:1000 ms | 内存限制:65535 KB难度:4描述小明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N 元钱就行”。今天一早小明就开始做预算,但是他想买的东西太多了,肯定会超过妈妈限定的N 元。于是,他把每件物品规原创 2016-05-25 20:05:37 · 247 阅读 · 0 评论