Chef and Loss
CodeChefOpen on judge ↗
Let's suppose a thief enters in Chef's home at the party night and he has $C$ capacity to take the items with him. In the Chef home, there are $N$ number of different items of $W1, W2 ... Wn$ weights and can give profit of $P1, P2 ... Pn$ respectively. Since the thief is very intelligent so he will make the maximum profit with less effort. Since the Chef is busy in other arrangement and you are
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