# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631758 | Stavab | Arranging Shoes (IOI19_shoes) | C++14 | 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 <vector>
using namespace std;
long long count_swaps(vector<int> S)
{
long long sum = 0;
int temp;
for(int i = 0; i < S.size() - 1; i += 2)
{
temp = 0;
for(int j = i + 1; j < S.size(); j++)
{
if(temp)
swap(temp, S[j]);
else
temp = S[j];
if(temp == -S[i])
{
if(temp < 0)
sum += j - i;
else
sum += j - i - 1;
break;
}
}
}
return sum;
}
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... |