Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
135068 杨博煊 求逆序对数 C++ 通过 100 1 MS 252 KB 260 2024-03-04 13:30:03

Tests(8/8):


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


测评信息: