Inversions Easy

1.5

2 votes
Easy
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*103
1 <= Ai <= 109

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

?