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

建议使用的浏览器:

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

6571:Packing

题目描述
Avin’s warehouse has a packing line with m outlets. There are n goods in total, which aren’t on the packing line. And the i-th good will be sent to the xi outlet at time ti . In each second, Avin can send at most one good from one outlet to the packing line. For outlet i, there is an associated buffer with size ai, and goods can be placed in the buffer. However, at the end of each second, if the number of goods b at the outlet is greater than ai , Avin has to pay the utilization fee b - ai . Since Avin wants to save money, he asks you to find a plan to send all the goods to the packing line with minimum utilization fee. In order to finish today’s work, Avin must send all goods to the packing line. Goods arrived at time ti can be sent to the packing line immediately at time ti.
输入解释
The first line contains two integers n and m (1 ≤ n, m ≤ 1, 000, 000) . In the following n lines, each of which contains two numbers ti (1 ≤ ti ≤ 1, 000, 000) and xi (1 ≤ xi ≤ m). In the next following line, there are m integers containing ai (1 ≤ ai ≤ 1, 000, 000).
输出解释
Print the minimum utilization fee.
输入样例
10 2
1 1
1 1
1 1
1 1
1 1
1 2
1 2
1 2
1 2
1 2
1 2
输出样例
21
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6571

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

共提交 0

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