Sereja and Permutations
Sereja have permutation p[1], p[2], ..., p[n]. Sereja have made n permutations q[1], q[2], ..., q[n], q[i] is permutation p without element i (we subtract 1 from all elements bigger than i). For example 8 1 2 3 4 5 6 7 without 5 is 7 1 2 3 4 5 6. Sereja have made random shuffle of q. Help Sereja find initial permutation p. Input First line contain number of test cases T. T tests follow. First li
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