# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
889450 | Lincito_31 | Arranging Shoes (IOI19_shoes) | C++14 | 1063 ms | 3164 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 <bits/stdc++.h>
#include "shoes.h"
using namespace std;
long long x=0;
long long count_swaps(vector<int> s) {
int indi_po=0;
int indi_ne=0;
while(!s.empty()){
int temp=s[0];
if(temp<0){
for(;indi_po<s.size();indi_po++){
if(s[indi_po]==-temp){
x+=indi_po-1;
s.erase(s.begin()+indi_po);
break;
}
}
indi_po--;
s.erase(s.begin());
}else{
for(;indi_ne<s.size();indi_ne++){
if(s[indi_ne]==-temp){
x+=indi_ne;
s.erase(s.begin()+indi_ne);
break;
}
}
indi_ne--;
s.erase(s.begin());
}
}
return x;
}
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... |