Chef And Painting
CodeChefOpen on judge ↗
Chef Yakawaka loves colors and enjoys painting. On a colorful day, Chef takes a ribbon, which consists of n units (they are numbered from 1 to n from left to right). The colorfulness of the i-th unit of the ribbon is 0 at first. Chef likes painting, we know. He takes up a paintbrush with color x and uses it to draw a line on a ribbon. In such a case some contiguous units are painted. Now much to
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