Fill Candies
CodeChefOpen on judge ↗
There are N boxes numbered from 1..N which need to be filled with candies. Assume there are infinite candies. The boxes are arranged in increasing order of capacity, and the ith box has capacity i. Every box has a specific cost ci. You fill candies in rounds. In every round, you pick a subset of boxes and fill them with candies. This subset should be such that each subsequent box picked in a round
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