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;
long long x=0;
long long count_swaps(vector<int> s) {
while(!s.empty()){
int i=0;
while(s[i]>0){
i++;
}
x+=i;
int abso=-s[i];
s.erase(s.begin()+i);
i=0;
while(s[i]!=abso){
i++;
}
x+=i;
s.erase(s.begin()+i);
}
return x;
}
# | 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... |