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 sum = 0;
for (int i = 0; i < (int)S.size(); i += 2)
{
int k;
for (k = i; k < (int)S.size(); k++)
{
if (S[k] < 0)
break;
}
for (int j = k; j > i; j--)
{
swap(S[j], S[j - 1]);
sum++;
}
for (k = i + 1; k < (int)S.size(); k++)
{
if (S[k] == -S[i])
{
break;
}
}
for (int j = k; j > i + 1; j--)
{
swap(S[j], S[j - 1]);
sum++;
}
}
return sum;
}
# | 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... |