Sum of inversions from a to b

Revision en1, by Sammmmmmm, 2023-07-10 06:20:12

Given two permutations a and b of n elements.

Find the sum of inversion for each permutation that whose lexicographical value is between a and b mod = 1e9 + 7.

N <= 200000

Thanks in advance!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sammmmmmm 2023-07-10 06:20:12 231 Initial revision (published)