# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
282456 | Ruba_K | Arranging Shoes (IOI19_shoes) | C++14 | 1094 ms | 3200 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(vector<int> v) {
int n = v.size() ;
long long ans = 0 ;
for(;!v.empty();){
int i = v.size() - 1;
int idx = i - 1 ;
while(v[idx] != v[i] * -1){
idx -- ;
ans ++ ;
}
v.erase(v.begin() + idx);
if(v[i] < 0)ans ++ ;
v.pop_back();
}
return ans;
}
Compilation message (stderr)
# | 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... |