Chef Needs Candies
CodeChefOpen on judge ↗
Chef recently worked in a Candy Store. He has decided he will start his own Candy Store. But he need suppliers of different candies, which will help him run his shop. He has N friends who are suppliers of candies, who'll support him. But when these suppliers tie up with one another, there is a chance of extracting more candies due to friendship among them. Each supplier will give Xi candies to Ch
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