← All problemsSign in

ICC by Chef

Chef is organizing an Intercontinental Coding Competition, in which many programmers from 5 continents: $P, Q, R, S$, and $T$ are participating. All coders from different continents are randomly sitting in a row in Chef's restaurant. Chef wants to find out the length of the longest chain of coders from the same continent and to which continent they belong. Help the Chef to complete his

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