# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
423543 | schse | Arranging Shoes (IOI19_shoes) | C++17 | 1088 ms | 3112 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"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
long long count_swaps(std::vector<int> s)
{
long long numswaps = 0;
for (int e, i = 0; i < s.size(); i += 2)
{
for (e = i + 1; e < s.size(); e++)
{
if (s[i] == -s[e])
break;
}
while (e-- > i + 1)
{
numswaps++;
swap(s[e], s[e + 1]);
}
if (s[i] > 0)
{
numswaps++;
swap(s[i], s[i + 1]);
}
}
return numswaps;
}
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... |