Inverse Inversions
Your task is to create a permutation of numbers 1,2,\dots,n that has exactly k inversions. An inversion is a pair (a,b) where a<b and p_a>p_b where p_i denotes the number at position i in the permutation. Input The only input line has two integers n and k. Output Print a line that contains the permutation. You can print any valid solution. Constraints - 1 \le n \le 10^6 - 0 \le k \le \frac
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