# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
601800 | Shithila | Arranging Shoes (IOI19_shoes) | C++14 | 1085 ms | 1876 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>
long long count_swaps(std::vector<int> s) {
long long len=s.size();
int n=len/2;
int count=0;
for(int i=0;i<len;i+=2)
{
int find=s[i]*(-1);
for(int j=i+1;j<len;j++)
{
if(s[j]==find)
{
if(find<0)
{
count=count+j-i;
}
else count=count+j-i-1;
for(int k=j-1;k>i;k--)
{
s[k+1]=s[k];
}
break;
}
}
}
return count;
}
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... |