赤裸裸的01背包
转载
2011-02-01 13:57:00
36阅读
2评论
#include <iostream> //0-1背包using namespace std;int dp[20000],weigh[5000],val[5000];int main(){ int n,m,i,j; cin>>n>>m; for(i=0;i<n;++i) cin>>weigh[i]>>val[i]; for(i=n-1;i>=0;--i) for(j=m;j>=weigh[i];--j) dp[j]=max(dp[j],dp[j-weigh[i]]+val[i]); cout<<dp[m]
转载
2011-07-22 19:57:00
84阅读
2评论
Charm BraceletTime Limit: 1000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:362464-bit integer IO format:%lld Java class name:...
转载
2015-04-10 21:31:00
68阅读
Charm Bracelet
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 31347
Accepted: 13942
Description
Bessie has gone to the mall's jewelry store and spies a ch
原创
2023-08-15 17:32:52
71阅读
入门题,最近又一次想不起来背包的dp方法,无奈又得找道水题找找感觉...Charm BraceletTime Limit:1000MSMemory Limit:65536KTotal Submissions:15063Accepted:6880DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from theN(1 ≤N≤ 3,402) a
转载
2013-03-21 16:47:00
67阅读
http://poj.org/problem?id=3624主要注意的是内存的优化yixiashi
原创
2023-08-23 09:59:09
59阅读
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each char
原创
2022-12-07 14:14:22
105阅读
Poj-3624 背包问题Poj链接题目解决代码 第一版:import java.util.Scanner;public class Main /** * 有N件物品,有一个体积为V的背包 * 第i件物品的费用为c[i],价值是w[i]; * 问:如何价值最大 4 6 1 4 2 6 3 12 2 7 */
原创
2022-09-08 09:48:09
85阅读
POJ 362401背包水题。DescriptionBessie has gone to the mall’s jewelry store and
原创
2023-06-12 14:17:20
19阅读
Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 13977 Accepted: 6381 Description Bessie has gone to the mall's jewelry store
转载
2012-09-13 22:21:00
61阅读
2评论
题目链接:http://poj.org/problem?id=3624
Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402)
原创
2021-07-15 11:06:00
91阅读
Charm BraceletTime Limit: 1 SecMemory Limit: 256 MB题目连接http://poj.org/problem?id=3624DescriptionBessie has gone to the mall's jewelry store and spies ...
原创
2021-07-16 14:56:22
93阅读
http://poj.org/problem?id=3624DescriptionBessie has gone to the mall's jewelry store and spies a charm bra...
转载
2019-02-01 14:41:00
65阅读
2评论
http://poj.org/problem?id=3624DescriptionBessie has gone to the mall's jewelry store and spies a charm bra...
转载
2019-02-01 14:41:00
85阅读
2评论
题目大意:你有一个体积为V的包。现在有出N件物品,每件物品都有相应的value和weight
原创
2023-04-07 13:38:16
60阅读
【题目链接】:click here~~【思路】基础01背包代码:/** Problem: POJ No.3624* Running time: 286MS* Complier: C++* Author: javaherongwei* Create Time: 10:22 2015/9/5 星期六*/#include <stdio.h>#include <string.h&
原创
2022-07-29 13:48:50
46阅读
Description:Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each ...
原创
2023-05-09 10:04:08
82阅读
Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22621 Accepted: 10157 Description Bessie has gone to the mall's jewelry stor
转载
2018-02-18 15:03:00
82阅读
2评论
Charm Bracelet
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 45191
Accepted: 19318
Description
Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of cours
原创
2021-09-04 17:04:35
121阅读
Charm Bracelet
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 45191
Accepted: 19318
Description
Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course
原创
2021-09-04 17:04:37
49阅读