# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520730 | peti1234 | Sorting (IOI15_sorting) | C++17 | 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 <bits/stdc++.h>
using namespace std;
int findSwapPairs(int n, int s[], int m, int x[], int y[], int p[], int q[]) {
int db=0;
for (int i=0; i<n; i++) {
if (t[i]==i) continue;
for (int j=i; j<n; j++) {
if (s[j]==i) {
p[db]=i, q[db]=j;
swap(s[i], s[j]);
db++
}
}
}
return db;
}