Chocolates for Everyone
CodeChefOpen on judge ↗
Chef's encounters with sweets continue with this problem! This time, he wants to distribute chocolates to his N students sitting on a long bench. The students are ordered according to the scores they got from the last exam. Chef wants to give more chocolates to the higher-scoring students. He also has a few more restrictions. Here are all the restrictions: - Every student must get at least one
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