Charm Bracelet
来源:互联网 发布:期货农产品数据库建立 编辑:程序博客网 时间:2024/05/18 17:26
Description
Bessie has gone to the mall's jewelry store and spies a charmbracelet. Of course, she'd like to fill it with the best charmspossible from the N (1 ≤ N ≤ 3,402) available charms.Each charm i in the supplied list has a weightWi (1 ≤ Wi ≤ 400), a'desirability' factor Di (1 ≤Di ≤ 100), and can be used at most once. Bessiecan only support a charm bracelet whose weight is no more thanM (1 ≤ M ≤ 12,880).
Given that weight limit as a constraint and a list of the charmswith their weights and desirability rating, deduce the maximumpossible sum of ratings.
Input
* Line 1: Two space-separated integers: N andM
* Lines 2..N+1: Line i+1 describes charm iwith two space-separated integers: Wi andDi
Output
* Line 1: A single integer that is the greatest sum of charmdesirabilities that can be achieved given the weightconstraints
Sample Input
4 61 42 63 122 7
Sample Output
23
Source
var f:array[0..12880] of longint;
begin
end.
- Charm Bracelet
- poj 3624 Charm Bracelet(0/1背包)
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- Charm Bracelet
- poj 3624 Charm Bracelet
- poj3624 Charm Bracelet
- poj 3624 Charm Bracelet
- poj3624 Charm Bracelet
- [JSOI2008]火星人prefix
- [Ahoi2009]fly 飞行棋
- poj 2387 Til the Cows Come Home
- poj 3128 Leonardo's Notebook
- 多米诺覆盖
- Charm Bracelet
- poj 3093 Margaritas on the River…
- poj 1276 Cash Machine
- poj 1742 Coins
- poj 1014 Dividing
- poj 2777 Count Color
- poj 3254Corn Fields
- poj 3126 Prime Path
- poj 1664 放苹果