https://www.codechef.com/viewsolution/62955036

'#include <bits/stdc++.h>

using namespace std;

int main()

{

long long n,i,j,c=0;

cin>>n;

long long a[n];

for(i=0;i<n;i++){

cin>>a[i];

}

for(i=n-1;i>=0;i–){

for(j=i-1;j>=0;j–){

if(a[i]<a[j]){

c=c+1;

}

}

}

cout<<c;

}

How to overcome this