
背包DP
twh233
嘻嘻
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
背包DP汇总
A - Bone Collector Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went原创 2017-02-17 16:45:42 · 469 阅读 · 0 评论 -
ZOJ - 3956 Course Selection System 01背包
https://vjudge.net/problem/ZOJ-3956 题意:就是让你求这个式子的最大值。要选的话h[i]和c[i]同时加,不选的话就都不加。 做法:看c[i]范围,很小是吧,考虑一下sigma_c[i] max=5e4,n范围完全够01背包的复杂度。 然后就01背包了。。 /// .-~~~~~~~~~-._原创 2017-11-13 18:28:08 · 236 阅读 · 0 评论 -
1450: 经商 01背包 dfs标记
传送门 Sample Input 1 5 3 7 5 10 3 2 4 3 1 100 1 2 2 3 1 4 Sample Output 10 题意懒得说了,中文题啊 做法:01背包 01背包 01背包啊,dfs判连接啊 //china no.1 #pragma comment(linker, "/STACK:1024000000,102400000原创 2017-09-28 18:30:19 · 394 阅读 · 0 评论 -
Codeforces Round #436 (Div. 2) E - Fire 01背包(模版)
传送门 题意: n个物品,每个物品有个需要拯救花的时间,截止时间,物品价值。 让你能救回的最大价值,打印选择方式。 做法: 这这这,这不就是,是个01背包吗。 //china no.1 #pragma comment(linker, "/STACK:1024000000,1024000000") #include #include #include #in原创 2017-09-27 00:12:21 · 339 阅读 · 0 评论 -
POJ 1015-Jury Compromise 背包dp最大差 记录路径
传送门 Jury Compromise Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 29953 Accepted: 7982 Special Judge Description In Frobnia, a far-away countr原创 2017-08-30 13:19:08 · 489 阅读 · 0 评论 -
西南交通大学第十三届ACM决赛 D.Music Problem 背包DP
传送门 转自mengxiang000 思路: 我们不难想到,如果n>3600的话,无论物品的大小,我们肯定能够凑出3600的倍数来。所以问题就可以变成O(3600*3600)的一个暴力背包了。 题目大意: 给出N个数,问我们能否从中选出一些数字,使得其加和为3600的倍数。 #include #include using na原创 2017-09-23 19:21:17 · 533 阅读 · 0 评论 -
度度熊与邪恶大魔王
传送门 #include #include #include #include #include #include #include using namespace std; #define pi acos(-1) #define endl '\n' #define srand() srand(time(0)); #define me(x,y) memset(x,y,sizeof原创 2017-08-05 14:42:41 · 2356 阅读 · 0 评论 -
01背包 Educational Codeforces Round 21 E. Selling Souvenirs
传送门 E. Selling Souvenirs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After several l原创 2017-05-16 23:43:24 · 389 阅读 · 0 评论 -
hdu 1114 完全背包
传送门 Piggy-Bank Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24208 Accepted Submission(s): 12253 Problem Description原创 2017-04-24 23:40:02 · 225 阅读 · 0 评论