← All problemsSign in

Perfect Necklace

CodeChefRating 2270Open on judge ↗

Chef wants to gift his girlfriend a necklace made of beads. The beads can be made of either Stone, Glass, Quartz, Ruby or Diamond (he need not use all five types of beads) . Each bead has a value associated with its beauty as follows - -2 for Stone - -1 for Glass - 0 for Quartz - 1 for Ruby - 2 for Diamond Each bead also has a cost given by S, G, Q, R and D for the respective bead. There are q

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