# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520967 | lordlorinc | Sorting (IOI15_sorting) | C++17 | 3 ms | 364 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 <bits/stdc++.h>
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
int res = 0;
for (int i = 0; i < N; i++){
int pos = -1;
for (int j = 0; j < N; j++){
if (S[j] == i) pos = j;
}
if (pos == i) continue;
P[res] = i;
Q[res] = pos;
std::swap(S[i], S[pos]);
res++;
}
return res;
}
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... |