제출 #531919

#제출 시각아이디문제언어결과실행 시간메모리
5319194fectaA Difficult(y) Choice (BOI21_books)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; #define ll long long #define int ll #define ld long double #define pii pair<int, int> #define f first #define s second #define boost() cin.tie(0), cin.sync_with_stdio(0) int h[100005], in[100005]; void solve(int n, int k, int a, int s) { vector<int32_t> ret; int sum = 0; for (int i = 1; i < k; i++) { h[i] = skim(i); sum += h[i]; in[i] = 1; } int lo = k, hi = n, mid; while (lo < hi) { mid = (lo + hi + 1) >> 1; h[mid] = skim(mid); if (sum + h[mid] > 2 * a) hi = mid - 1; else lo = mid; } in[lo] = 1; if (sum + h[lo] >= a) { for (int i = 0; i < 100005; i++) if (in[i]) ret.push_back(i); answer(ret); } for (int i = 1; i < k; i++) { h[lo - i] = skim(lo - i); sum += h[lo - i] - h[k - i]; in[lo - i] = 1, in[k - i] = 0; if (sum + h[lo] >= a) { for (int i = 0; i < 100005; i++) if (in[i]) ret.push_back(i); answer(ret); } } impossible(); }

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

/usr/bin/ld: /tmp/cctINiHQ.o: in function `main':
grader.cpp:(.text.startup+0x83): undefined reference to `solve(int, int, long long, int)'
collect2: error: ld returned 1 exit status