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 <bits/stdc++.h>
using namespace std;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[])
{
for (int R = 0; R <= M; R++)
{
int f = -1;
for (int i = 0; i < N; i++)
{
if (S[i] != i)
{
f = i;
break;
}
}
if (f == -1) return R;
swap(X[R], Y[R]);
f = 0;
for (int i = 0; i < N; i++)
{
if (S[i] != i)
{
f = i;
break;
}
}
P[R] = f, Q[R] = S[f];
swap(S[f], S[S[f]]);
}
assert(0);
return -1;
}
# | 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... |