Sorted Permutation Rank with Repeats
- Time : O(|A|log(mod))
- Space : O(|A|)
c++
1 | long long modpow(long long n, long long x, long long mod) { |