# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94892 | someone_aa | Sorting (IOI15_sorting) | C++17 | 3 ms | 512 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 <bits/stdc++.h>
#include "sorting.h"
using namespace std;
const int maxn = 110;
int value[maxn], ind[maxn];
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
int br = 0;
for(int i=0;i<N;i++) {
value[i] = S[i];
ind[S[i]] = i;
}
for(int i=0;i<N;i++) {
if(value[i] == i) continue;
P[br] = i;
Q[br] = ind[i];
ind[value[i]] = ind[i];
value[ind[i]] = value[i];
value[i] = i;
ind[i] = i;
br++;
}
return br;
}
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... |