Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
127508 谢思涵 计算函数值 C++ Wrong Answer 0 0 MS 256 KB 327 2024-01-25 09:20:24

Tests(0/5):


#include <iostream> #include <algorithm> using namespace std; int a[501000]; int main() { int n; cin >> n; int cnt = 0; 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++) if(a[j] < a[i]) {swap(a[j], a[i]); cnt++;} cout << cnt << endl; return 0; }


Judgement Protocol: