← All problemsSign in

DJ Party (keteki)

During the DJ party, gentleman and Ladies, formed a queue of n people in the bar. Initially the all stood in the order they entered the bar. However, after a while the gentleman started feeling awkward for standing in front of the ladies in the queue and they started letting the ladies move forward each second. Lets describe the process more precisely. Let's say that the positions in the queue

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