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)