当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6508:Problem I. Spell Boost

题目描述
Shadowverse is a funny card game. One day you are playing a round of this game.
You have n cards, each with two attributes wi and xi. If you use card i, you will cost wi points of power and cause xi damage to the enemy.
Among them, there are two special types of cards: some cards are magic cards and some have “spell boost effect”. Everytime you have used a magic card, for each unused “spell boost effect” card i: if the the current cost of i (i.e. wi) is positive, then wi will be reduced by 1. Note that some cards may be both
magic cards and have spell boost effect.
Now you have W points of power, you need to calculate maximum total damage you can cause.
输入解释
Input is given from Standard Input in the following format:
n W
w1 x1 is_magic1 is_spell_boost1
w2 x2 is_magic2 is_spell_boost2
...
...
...
wn xn is_magicn is_spell_boostn
Constraints
1 ≤ n ≤ 500
0 ≤ W, wi, xi ≤ 500, and all of them are integers.
is_magici means: If this card is magic card, the value is 1, otherwise the value is 0.
is_spell_boosti means: If this card has spell boost effect, the value is 1, otherwise 0
输出解释
One integer representing the maximum total damage.
输入样例
3 3
3 3 1 1
2 3 1 1
1 3 1 1
4 3
3 3 1 1
3 4 1 0
1 3 0 1
1 0 1 0
输出样例
9
7
来自杭电HDUOJ的附加信息
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6508

最后修改于 2020-10-25T23:31:56+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/6000MS(Java/Others) 262144/262144K(Java/Others)