# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
543075 | Anas_AbuAmar | Arranging Shoes (IOI19_shoes) | C++14 | 1084 ms | 3896 KiB |
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 namespace std;
long long count_swaps(std::vector<int> s) {
long long ans = 0;
deque<int>d;
for (auto &i:s){
d.push_back(i);
}
while(!d.empty()){
int cur = d.front();
auto next = find(d.begin() , d.end() ,cur*-1);
ans += (next-d.begin())-1;
if (cur > 0 ){
ans++;
}
d.erase(next);
d.pop_front();
}
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... |