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;
using vi = vector<int>;
using ll = long long;
ll count_swaps(vi s) {
ll cnt = 0;
while (not s.empty()) {
int i = 1;
while (s[i] != -s[0]) {
++i;
}
cnt += i-1;
if (s[0] > 0) ++cnt;
s.erase(s.begin() + i);
s.erase(s.begin());
}
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... |