[Monotonous queue] HDU 4122 Alice's mooncake shop

Source: Internet
Author: User

Channel: http://acm.hdu.edu.cn/showproblem.php? Pid = 1, 4122

Given N and M, there are N orders. You can make moon cakes at M time. The time is calculated by hour. You can make several moon cakes at any time. Next, N actions are performed on N orders, including the time and quantity. Given T and S, it indicates the warranty time of each moon cake and the overhead of every one hour. Then M behavior corresponds to the cost of making moon cakes at every moment. How much is required to complete all orders

Train of Thought: maintain a monotonous queue and drop the pop that does not meet the requirements during the fresh-keeping period.

Code:Https://github.com/Mithril0rd/Rojo/blob/master/hdu4122.cpp

TAG: Thanks to Hua Ge and Xin Ge.

[Monotonous queue] HDU 4122 Alice's mooncake shop

Related Article

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.