Submission #528873

#TimeUsernameProblemLanguageResultExecution timeMemory
528873OttoTheDinoA Difficult(y) Choice (BOI21_books)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // #define rep(i,s,e) for (ll i = s; i <= e; ++i) #define all(a) a.begin(), a.end() typedef long long ll; const ll mx = 2e5; ll x[mx]; void solve(ll n, ll k, long long a, ll S) { vector<int> ans(k); iota(all(ans),1); ll s = 0; rep (i,1,k) { x[i] = skim(i); s += x[i]; } if (s>2*a) impossible(); else if (s>=a) { answer(ans); return; } else { ll lo = k+1, hi = n+1; while (lo<hi) { ll mid = (lo+hi)/2; x[mid] = skim(mid); if (x[mid]>=a) hi = mid; else lo = mid+1; } if (lo!=n+1) { if (s+x[lo]-x[k]<=2*n) { ans[k-1] = lo; answer(ans); return; } } rep (i,1,k) { x[n-i+1] = skim(n-i+1); s += x[n-i+1] - x[k-i+1]; ans[k-i] = n-i+1; if (s>=a) { answer(ans); return; } } } impossible(); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccGochY6.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