제출 #307682

#제출 시각아이디문제언어결과실행 시간메모리
307682kylych03선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "boxes.h" #include "grader.cpp" using namespace std; long long delivery(int N, int K, int L, int p[]) { sort(p, p+N); vector <long long > a,b; for(int i = 0; i < N; i++){ if(p[i] <= L/2) a.push_back(p[i]); else b.push_back(L-p[i]); } sort(b.begin(), b.end()); long long res = 0; for(int i = 0 ; i < a.size();i++){ if((i+1)% K == 0) res += (a[i] * 2); } for(int i = 0 ; i < b.size();i++) if((i+1)%K == 0) res+=(b[i] * 2); if(a.size()%K !=0) res+=(a[a.size() - 1] * 2); if(b.size()%K!=0) res+=( b[b.size() - 1] * 2); long long res1 = L; while(K--) { if(a.size()==0 && b.size()==0) break; if(a.size()==0){ b.pop_back(); continue; } if(b.size()==0){ a.pop_back(); continue; } if(a.back() > b.back()) a.pop_back(); else b.pop_back(); } for(int i = 0 ; i < a.size();i++){ if((i+1)% K == 0) res1 += (a[i] * 2); } for(int i = 0 ; i < b.size();i++) if((i+1)%K == 0) res1+=(b[i] * 2); if(a.size()%K !=0) res1+=(a[a.size() - 1] * 2); if(b.size()%K!=0) res1+=( b[b.size() - 1] * 2); if(res1 < res) res= res1; return res; }

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

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