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>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
ll count_swaps(vector<int> s){
int n = s.size()/2;
ll cnt = 0;
vector <int> v, sth;
for(int i = 0; i < n; i++) v.pb(2*i);
for(int i = 0; i < 2*n; i++) if(s[i] < 0) sth.pb(i);
for(int i = 0; i < n; i++) cnt+=abs(v[i] - sth[i]);
return cnt;
}
# | 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... |