← All problemsSign in

Celebrating Brithday

Today is Limak's, the bear's birthday and Polycarp is given the task to entertain the guests at the party. Polycarp is having N elements denoted by A1 , A2 , .... AN. All Ai's are distinct and are in range 1 to N. He has given Q queries of the form of two numbers i,e K and P to each person present at the party. The query asks the person to find the minimum number at position P from all the possi

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