제출 #318015

#제출 시각아이디문제언어결과실행 시간메모리
318015wildturtle커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "sorting.h" using namespace std; int a,le,ri,ans,mid; vector <int> S1,A; vector < pair < int , int > > v; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { le=0; ri=M; ans=-1; while(le<=ri) { mid=(le+ri)/2; for(int i=0;i<N;i++) S1[i]=S[i]; for(int i=0;i<mid;i++) { swap(S1[X[i]],S1[Y[i]]); } for(int i=0;i<N;i++) { A[S1[i]]=i; } v.clear(); for(int i=0;i<N;i++) { if(S1[i]==i) continue; v.push_back({i,S1[i]}); swap(S1[i],S1[A[i]]); swap(A[i],A[S1[A[i]]]); } a=v.size(); if(a<=mid) { for(int i=0;i<N;i++) { S1[i]=S[i]; A[S1[i]]=i; } for(int i=0;i<M;i++) { swap(A[S1[X[i]]],A[S1[Y[i]]]); swap(S1[X[i]],S1[Y[i]]); if(i<a) { P[i]=A[v[i].first]; Q[i]=A[v[i].second]; swap(A[v[i].first],A[v[i].second]); swap(S1[P[i]],S1[Q[i]]); } else { P[i]=0; Q[i]=0; } } ri=mid-1; ans=mid; } else le=mid+1; } return ans; }

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

prize.cpp:2:10: fatal error: sorting.h: No such file or directory
    2 | #include "sorting.h"
      |          ^~~~~~~~~~~
compilation terminated.