提交时间:2023-08-23 09:29:03

运行 ID: 99545

#include<bits/stdc++.h> using namespace std; int a[114514]; int main(){ int n,sum = 0; cin>>n; for (int i = 1;i <= n;i++){ cin>>a[i]; } for (int i = 1;i <= n;i++){ for (int j = i + 1;j <= n;j++){ sum += (a[i] > a[j]); } } cout<<sum; return 0; }