UV 10163-storage keepers (DP)

Source: Internet
Author: User

From http://blog.csdn.net/shuangde800

Question link: Click the open link

Question

There are n warehouses for m to look. One warehouse can only be managed by one person, and one person can manage multiple warehouses.

Each person has a capacity pi. If he takes care of K warehouses, the security value of each warehouse is PI/K (rounded down)

If a warehouse is unattended, its security value is 0. Security value of all warehouses L = min {security value of each warehouse}

If you hire a person whose salary is equal to his capacity Pi.

Select some employees from M and ask the maximum security value of all warehouses. In the case of the highest security value, find the minimum price for employment.

Ideas

F [I] [J] indicates the maximum security value of the previous one who manages J warehouses.

F [I] [J] = max {min {f [I-1] [J-K], p [I]/k }, 0 <= k <= J & K is the number of warehouses managed by the I user}

Then ask for the minimum price,

G [I] [J] indicates the minimum price used to manage the maximum security values of the first I people in the warehouse.

G [I] [J] = min {G [I-1] [J-K] + P [I], P [I]/k> = f [m] [N] & 0 <= k <= J}

Code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.