제출 #314790

#제출 시각아이디문제언어결과실행 시간메모리
314790kylych03정렬하기 (IOI15_sorting)C++14
컴파일 에러
0 ms0 KiB
#include"sorting.h" #include<bits/stdc++.h> #include"grader.cpp" using namespace std; int n,s[800005],x[800005],y[800005],tmp[800005],pos[800005]; vector<pair<int,int>>res; bool check(int m){ int i; for(i=0;i<n;i++)tmp[i]=s[i]; for(i=0;i<m;i++)swap(tmp[x[i]],tmp[y[i]]); for(i=0;i<n;i++)pos[tmp[i]]=i; vector<pair<int,int>>sw; res.clear(); for(i=0;i<n;i++){ if(pos[i]==i)continue; sw.push_back({tmp[i],tmp[pos[i]]}); swap(tmp[pos[i]],tmp[i]); swap(pos[tmp[pos[i]]],pos[tmp[i]]); } if(sw.size()>m)return 0; for(i=0;i<n;i++)tmp[i]=s[i],pos[tmp[i]]=i; for(i=0;i<sw.size();i++){ swap(tmp[x[i]],tmp[y[i]]); swap(pos[tmp[x[i]]],pos[tmp[y[i]]]); res.push_back({pos[sw[i].first],pos[sw[i].second]}); swap(tmp[pos[sw[i].first]],tmp[pos[sw[i].second]]); swap(pos[tmp[pos[sw[i].first]]],pos[tmp[pos[sw[i].second]]]); } for(;i<m;i++)res.push_back({0,0}); return 1; } int findSwapPairs(int N,int S[],int m,int X[],int Y[],int P[],int Q[]){ n=N; int i; for(i=0;i<n;i++)s[i]=S[i]; for(i=0;i<m;i++)x[i]=X[i]; for(i=0;i<m;i++)y[i]=Y[i]; check(m); for(i=0;i<m;i++)P[i]=res[i].first,Q[i]=res[i].second; return m; }

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

sorting.cpp:3:9: fatal error: grader.cpp: No such file or directory
    3 | #include"grader.cpp"
      |         ^~~~~~~~~~~~
compilation terminated.