Colored Bottles
CodeChefOpen on judge ↗
Harry has N bottles in front of him, in a straight line. Each bottle has coloured water in it, the colour of the water in the bottle is one of 100 different colours (each colour has a colour code from 0 to 99). He wants to mix all the coloured water together. At each step, he is going to take two bottles that are next to each other and mix them and put the resulting bottle in their place. When
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