Codeforces Round #437 (Div. 2, based on Memsql start[c]up 3.0-round 2)

Source: Internet
Author: User
Tags memsql

A

Sign

B

Test instructions

Analysis

C

Test instructions

There are two kinds of pizza, each pizza can be divided into S block, there are n individuals, respectively, give the number of blocks that n people need, eat the first 1 pieces of the value obtained, eat the value of the second 1, ask in the need for the minimum number of pizza can get the maximum value of how much

Analysis

Key points: Everyone to the best, the two pizza the rest will not exceed two Zhang Pizza

So you can take all the best, if the remaining can be composed of one, consider the first conversion to the second and the second to the first to take the best

The best way to handle the rest:

Sort the difference between the first value and the second value

D

More difficult

E. Buy low Sell high

Test instructions

There is an item you know the price of N days, there is a price per day, you can choose to buy or sell (previously bought), ask you can get the maximum value (by buying and selling the difference obtained)

Analysis

can only buy or sell every day as can buy and buy every day, take a small root cone, put two of the same value each day, and delete the smallest, the last heap of the number is the largest n number minus the smallest n number is the request

Codeforces Round #437 (Div. 2, based on Memsql start[c]up 3.0-round 2)

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.