This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
int count_swaps(vector<int> v)
{
int n = v.size();
if(n == 2){
return (v[0] < v[1] ? 0 : 1);
}
vector<int> e(n/2);
int ans = 0, k = 0;
for(int i = 0;i<n;i++){
if(v[i] < 0){
ans += abs(i - k);
k += 2;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |