제출 #885648

#제출 시각아이디문제언어결과실행 시간메모리
885648nguyentunglam팀들 (IOI15_teams)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define fi first #define se second #define endl "\n" #define ii pair<int, int> #define all(v) v.begin(), v.end() using namespace std; const int N = 1e5 + 10; pair<int, int> a[N]; int n; void init(int _n, vector<int> A, vector<int> B) { n = _n; for(int i = 1; i <= n; i++) { a[i] = make_pair(A[i - 1], B[i - 1]); } sort(a + 1, a + n + 1); } int can (int m, vector<int> k) { priority_queue<int, vector<int>, greater<int> > q; for(int i = 0, j = 1; i < m; i++) { int x = k[i]; while (j <= n && a[j].first <= x) { q.push(a[j].second); j++; } int cnt = x; while (!q.empty() && cnt > 0) { int y = q.top(); q.pop(); if (y >= x) cnt--; } if (cnt) return 0; } return 1; } #ifdef ngu int32_t main() { freopen ("task.inp", "r", stdin); freopen ("task.out", "w", stdout); int n; cin >> n; vector<int> x(n), y(n); for(int i = 0; i < n; i++) cin >> x[i] >> y[i]; init(n, x, y); int q; cin >> q; while (q--) { int m; cin >> m; vector<int> k(m); for(int i = 0; i < m; i++) cin >> k[i]; cout << can(m, k) << endl; } } #endif // ngu

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

/usr/bin/ld: /tmp/cctNzk8t.o: in function `main':
grader.c:(.text.startup+0x88): undefined reference to `init(int, int*, int*)'
/usr/bin/ld: grader.c:(.text.startup+0x242): undefined reference to `can(int, int*)'
collect2: error: ld returned 1 exit status