# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
830568 | Shithila | Sorting (IOI15_sorting) | C++14 | 0 ms | 0 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>
using namespace std;
int findSwapPairs(int n, int s[], int M, int X[], int Y[], int P[], int Q[]) {
int pos[N];
for(int i=0;i<N;i++) pos[s[i]]=i;
for(int i=0;i<N;i++)
{
P[i]=i;
Q[i]=pos[s[i]];
int x=pos[i];
pos[i]=i;
pos[s[i]]=x;
}
return n;
}