← All problemsSign in

Mega mu - 1

CodeChefRating 3417Open on judge ↗

A positive integer $N\ge 1$ is given. An $N$-uple $(x_1, x_2, \dots, x_N)$ of nonnegative integers is special if, after we remove all entries which are zero, its entries are nondecreasing. For example $(0, 2, 0, 0, 4, 0, 4, 5, 0, 0)$ is special, but $(3, 2, 0)$ and $(0, 1, 3, 0, 0, 1, 0)$ are not. One can show that there is a unique function $\mu$ defined on the $N$-uples of nonnegative integers

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