Maximum Deliciousness
A new patisserie has opened up to rave reviews. You, in your quest for deliciousness, are going to visit it. The patisserie has $N$ pastries. With your trained eye, you judge that the $i$-th of them has *deliciousness* $A_i$. Of course, you want to eat pastries whose total deliciousness is as high as possible. Unfortunately, you can't just buy everything out. There are $K$ customers in the sto
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