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!
Sum of inversions from a to b
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!