# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1195149 | nikulid | 정렬하기 (IOI15_sorting) | C++20 | 0 ms | 0 KiB |
#include "sorting.h"
#include <vector>
using namespace std;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
// we are given S[], M, X[], Y[]
// we are to give P[], Q[]
vector<int> ns;
for(int i=0; i<N; i++){
ns.push_back(S[i]);
}
for(int i=0; i<n; i++){
P[i] = i;
Q[i] = ns[i];
swap(ns[i], ns[ns[i]]);
}
return 1;
}