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 "shoes.h"
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll count_swaps(vector<int> s) {
list<int> sl(s.begin(), s.end());
ll swaps = 0;
for (auto it = sl.begin(); it != sl.end(); ++it) {
int v = *it;
auto b = next(it);
while (*b != -v) {
swaps++;
++b;
}
if (v > 0)
swaps++;
sl.erase(b);
}
return swaps;
}
# | 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... |