← 返回 amazon 的题目列表Warehouse Management with Heap
类型:online_judge
amazon
Given a set of warehouse requirements [R1, R2, ..., Rn] and a set of warehouse capacities [C1, C2, ..., Cm], use a heap to manage warehouse assignments to minimize the total cost. The total cost is defined as the sum of unmet demands. Warehouses can either fully meet a requirement or not at all, but cannot partially meet it. Provide a solution with test cases.
Example
Input
5
[4, 6, 3, 8]
[5, 10, 6, 7]