Inversions Hard

4

1 votes
Problem

Given an array A of N integers. Find total number of pairs such that i < j and A[i] > A[j].

Constraints
1 <= N <= 2*105
1 <= Ai <= 109

Sample Input
5
5 1 2 4 3
Sample Output
5
Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?