Construction Problem

Revision en1, by iLoveIOI, 2020-04-24 12:49:34

Given n<=1000000 and k<=n*(n-1)/2 construct a sequence of length n that has exactly k inversions. How do I solve this? Thanks!

Tags #constructive algorithms

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English iLoveIOI 2020-04-24 12:49:34 148 Initial revision (published)