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

建议使用的浏览器:

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

6767:New Equipments

题目描述
Little Q's factory recently purchased $m$ pieces of new equipment, labeled by $1,2,\dots,m$.

There are $n$ workers in the factory, labeled by $1,2,\dots,n$. Each worker can be assigned to no more than one piece of equipment, and no piece of equipment can be assigned to multiple workers. If Little Q assigns the $i$-th worker to the $j$-th piece of equipment, he will need to pay $a_i\times j^2+b_i\times j+c_i$ dollars.

Now please for every $k$ ($1\leq k\leq n$) find $k$ pairs of workers and pieces of equipment, then assign workers to these pieces of equipment, such that the total cost for these $k$ workers is minimized.
输入解释
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 $m$ ($1 \leq n \leq 50$, $n\leq m\leq 10^8$), denoting the number of workers and the number of pieces of equipment.

Each of the following $n$ lines contains three integers $a_i,b_i$ and $c_i$ ($1\leq a_i\leq 10$, $-10^8\leq b_i\leq 10^8$, $0\leq c_i\leq 10^{16}$, $b_i^2\leq 4a_ic_i$), denoting a worker.
输出解释
For each test case, output a single line containing $n$ integers, the $k$-th ($1\leq k\leq n$) of which denoting the minimum possible total cost for $k$ pairs of workers and pieces of equipment.
输入样例
1
3 5
2 3 10
2 -3 10
1 -1 4
输出样例
4 15 37
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6767

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

共提交 0

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