# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223082 | emil_physmath | 정렬하기 (IOI15_sorting) | C++17 | 14 ms | 384 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 "sorting.h"
#include <vector>
using namespace std;
int findSwapPairs(int n, int a[], int m, int x[], int y[], int p[], int q[])
{
for (int i = 0; i < n; ++i)
{
swap(a[x[i]], a[y[i]]);
vector<int> b(a, a + n);
for (int j = i + 1; j < n; ++j)
swap(b[x[j]], b[y[j]]);
for (int j = 0; j < n; ++j)
if (a[j] == i)
{
p[i] = j;
break;
}
for (int j = 0; j < n; ++j)
if (a[j] == b[i])
{
q[i] = j;
break;
}
swap(a[p[i]], a[q[i]]);
}
return n;
}
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... |