#include<bits/stc++.h>
using namespace std;
int a[3000];
int main()
{ int n,cnt;
  cin>>n;
  for(int i=0;i<n;i++)cin>>a[i];
  
  for(int i=0;i<n;i++)
  	for(int j=1; j<n;j++)
  	{
  		if(a[i]>a[j])
		 {
		   swap(a[i],a[j])	;
		  cnt++; } }
     cout<<cnt;
     



return 0;	
}

1 comments

  • 1

Information

ID
689
Time
1000ms
Memory
256MiB
Difficulty
6
Tags
# Submissions
114
Accepted
35
Uploaded By