제출 #1235504

#제출 시각아이디문제언어결과실행 시간메모리
1235504porquenomedejainiciarsesion정렬하기 (IOI15_sorting)C++20
컴파일 에러
0 ms0 KiB

#include <bits/stdc++.h>
#include <sorting.h>
using namespace std;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
    map<int,int> pos;
    for (int i = 0; i < N; i++) {
        pos[S[i]] = i;
    }
    int cnt = 0;
    for (int i=0;i<N;i++) {
        while (S[i] != i) {
            int correct_pos=pos[i]; 
            P[cnt]=i;
            Q[cnt]=correct_pos;
            cnt++;
            pos[S[i]]=correct_pos;
            pos[S[correct_pos]]=i;
            swap(S[i], S[correct_pos]);
        }
    }
    return cnt;
}

컴파일 시 표준 에러 (stderr) 메시지

sorting.cpp:3:10: fatal error: sorting.h: No such file or directory
    3 | #include <sorting.h>
      |          ^~~~~~~~~~~
compilation terminated.