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

建议使用的浏览器:

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

6772:Lead of Wisdom

题目描述
In an online game, "Lead of Wisdom" is a place where the lucky player can randomly get powerful items.



There are $k$ types of items, a player can wear at most one item for each type. For the $i$-th item, it has four attributes $a_i,b_i,c_i$ and $d_i$. Assume the set of items that the player wearing is $S$, the damage rate of the player $DMG$ can be calculated by the formula:

\[DMG=\left(100+\sum_{i\in S} a_i\right)\left(100+\sum_{i\in S} b_i\right)\left(100+\sum_{i\in S} c_i\right)\left(100+\sum_{i\in S} d_i\right)\]

Little Q has got $n$ items from "Lead of Wisdom", please write a program to help him select which items to wear such that the value of $DMG$ is maximized.
输入解释
The first line of the input contains a single integer $T$ ($1 \leq T \leq 10$), the number of test cases.

For each case, the first line of the input contains two integers $n$ and $k$ ($1 \leq n,k \leq 50$), denoting the number of items and the number of item types.

Each of the following $n$ lines contains five integers $t_i,a_i,b_i,c_i$ and $d_i$ ($1\leq t_i\leq k$, $0\leq a_i,b_i,c_i,d_i\leq 100$), denoting an item of type $t_i$ whose attributes are $a_i,b_i,c_i$ and $d_i$.
输出解释
For each test case, output a single line containing an integer, the maximum value of $DMG$.
输入样例
1
6 4
1 17 25 10 0
2 0 0 25 14
4 17 0 21 0
1 5 22 0 10
2 0 16 20 0
4 37 0 0 0
输出样例
297882000
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6772

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

共提交 0

通过率 --%
时间上限 内存上限
8000/8000MS(Java/Others) 524288/524288K(Java/Others)