Salary Queries
A company has n employees with certain salaries. Your task is to keep track of the salaries and process queries. Input The first input line contains two integers n and q: the number of employees and queries. The employees are numbered 1,2,\ldots,n. The next line has n integers p_1,p_2,\ldots,p_n: each employee's salary. After this, there are q lines describing the queries. Each line has one of
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