← All problemsSign in

Clan Expansion

CodeChefRating 1944Open on judge ↗

The island of Teliarganj is divided into $N$ distinct territories ruled by several different clans, each having an unique integer between $1$ and $N$ assigned to it. The island can be considered a linear place, with the $i$-th territory located next to the $(i+1)$-th one. The $i$-th territory is initially ruled by clan $A_i$. Chef does not like this division of the island into several clans, an

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