Sale
Chef knows the projected sales of his store for the next $N$ days. The projected sales of the $i^{th}$ day is $A_i$. On any particular day, Chef can announce that his shop is closing which will **double** his sales for that day, but since Chef is a man of his word, he won't make any sale after that day. Find the **maximum** possible total sales which Chef can make. ### Input - The first line of
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start