number of permutation with k inversions
-
06-11-2019 - |
문제
We are given two numbers N and K.
N <= 10^9.
K<=min{1000,(N*(N-1))/2}
We need to find numbers of permutations of ( 1 to N ) such that inversions are exactly K.
If N was <= 10^3. It would be a simple Dynamic programming question.
https://www.geeksforgeeks.org/number-of-permutation-with-k-inversions/
can we optimize it?
올바른 솔루션이 없습니다
제휴하지 않습니다 cs.stackexchange