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>
#include "shoes.h"
using namespace std;
typedef long long ll;
#define pb push_back
#define all(x) begin(x), end(x)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll count_swaps(vector<int> arr){
ll ans=0;
while(!arr.empty()){
int x = arr.front();
int i = find(arr.begin(), arr.end(), -x)-arr.begin();
ans+=i-(x<0);
arr.erase(arr.begin()+i);
arr.erase(arr.begin());
}
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... |