제출 #372952

#제출 시각아이디문제언어결과실행 시간메모리
372952Joshc로봇 (IOI13_robots)C++11
컴파일 에러
0 ms0 KiB
#include <cstdio> #include <algorithm> #include <vector> #include <queue> using namespace std; int putaway(int a, int b, int t, int X[], int Y[], int W[], int S[]) { vector<int> x, y; for (int i=0; i<a; i++) x.push_back(X[i]); for (int i=0; i<b; i++) y.push_back(Y[i]); sort(x.begin(), x.end()); sort(y.begin(), y.end()); vector<pair<int, int> > v; for (int i=0; i<t; i++) { v.emplace_back(W[i], S[i]); if ((x.empty() || W[i]>=x.back()) && (y.empty() || S[i]>=y.back())) return -1; } sort(v.begin(), v.end()); reverse(y.begin(), y.end()); int low=1, high=t, mid; while (low != high) { mid = (low+high) >> 1; priority_queue<int> pq; int cur = 0; for (int i : x) { while (cur<t && v[cur].first<i) pq.push(v[cur++].second); int z = min((int)pq.size(), mid); for (int i=0; i<z; i++) pq.pop(); } for (; cur<t; cur++) pq.push(v[cur].second); for (int i : y) { int z = 0; while (z++<mid && !pq.empty() && pq.top()<i) pq.pop(); } if (pq.empty()) high = mid; else low = mid+1; } return low; }

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

/tmp/ccJgghuX.o: In function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status