← 返回 amazon 的题目列表Minimize Cost for Distinct Sizes
类型:online_judge
One of the products listed on Amazon Ecommerce is available in n sizes as indicated in the array size. The category manager recognizes that some of the sizes are repetitive and do not provide a good user experience. To make the best use of inventory, the product should be available in distinct sizes. The size of the i-th product, size[i], can be increased by one unit for an amount in the cost array, cost[i]. Given the arrays size and cost for the product, find the minimal total cost in order to make all the sizes distinct.
Example
Input
1
5
1 3 2 3 3
5 6 1 2 1