# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1263983 | liangjeremy | Sorting (IOI15_sorting) | C++20 | 0 ms | 0 KiB |
#include<"sorting".h>
#include<bits/stdc++.h>
#define fi first
#define se second
//#define int long long
using namespace std;
using db=double;
using ll=int64_t;
using sll=__int128;
using lb=long double;
int findSwapPairs(int n, int a[], int m, int x[], int y[], int p[], int q[]){
int lst=0;
for(int i=0; i<n; i++){
if(a[i]==i)continue;
for(int j=i+1; j<n; j++){
if(a[j]==i){
p[lst]=i; q[lst]=j; swap(a[i],a[j]); lst++; break;
}
}
}
return lst;
}