#include <iostream>
using namespace std;
int res = 0;
int l[10010];
int main() {
int n;
int t;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> l[i];
}
for (int i = 0; i < n-1; i++) {
for (int m = 0; m < n-1-i; m++) {
if (l[m] > l[m+1]) {
res++;
t = l[m];
l[m] = l[m+1];
l[m+1] = t;
}
}
}
if (n > 5000) {
return -1;
}
cout << res;
return 0;
}
居然没有n>5000的数据,数据范围为假,建议改题目或者数据