# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
275310 | suren | Arranging Shoes (IOI19_shoes) | C++14 | 1087 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<bits/stdc++.h>
using namespace std;
#define ll long long
#define mk make_pair
#define pb push_back
#define F first
#define S second
int count_swaps( vector < int > vc ){
int ans = 0, i;
while( vc.size() > 0 ){
for( i = 1; i < vc.size(); i ++ ){
if( vc[i] == vc[0] * -1 ){
if( vc[i] < 0 ){
ans += i;
vc.erase( vc.begin() + i );
vc.erase( vc.begin() + 0 );
break;
}
else{
ans += i-1;
vc.erase( vc.begin() + i );
vc.erase( vc.begin() + 0 );
break;
}
}
}
}
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... |