← All problemsSign in

Colors

Credenz'14 design team is doing their best to paint the main poster. However they are stuck in a problem. There are N colors in total numbered as 1, 2, 3 . . N . The main poster needs Ai color quantity of the ith color. The design team has a set of N colors, ith color being of quantity Bi. There are some colors which can be obtained from a combination of some other colors. Also those colors can b

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start