Nested Rotation
CodeChefOpen on judge ↗
Chef is feeling tired after his birthday party, so he decided to ask you to compute the result of the following pseudocode rather than explain this problem. The input for the code consists of an integer $V$ and two permutations $P_1, P_2, \ldots, P_N$ and $Q_1, Q_2, \ldots, Q_N$ of the integers $1$ through $N$. Don't worry, Chef will give you this input. ``` function Log2(x): if x is at m
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