Problem 1
CodeChefOpen on judge ↗
In a box, you have some candies of N flavours. For each flavour i you know the number of candies A[i] having that flavour. You can match two candies of the same flavour to make a pair, but not two of different flavours. If you pick the candy without looking in the box, what's the minimum number of candies you need to pick to be sure you can make at least K pairs? ###Input: The first line conta
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