Submission #639658

#TimeUsernameProblemLanguageResultExecution timeMemory
639658null_aweA Difficult(y) Choice (BOI21_books)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "books_sample.cpp" using namespace std; #define ll long long void solve(int n, int k, ll a, s) { int lo = -1, hi = n; while (lo < hi - 1) { int mid = (lo + hi) / 2; if (skim(mid + 1) <= a) lo = mid; else hi = mid; } vector<ll> vals(n); for (int i = 0; i < k; ++i) vals[i] = skim(i + 1); for (int i = max(hi - k, 0); i < min(hi, n); ++i) vals[i] = skim(i + 1); ll sum = 0; vector<int> ans(k); for (int i = 0; i < k - 1; ++i) sum += vals[i], ans[i] = i + 1; if (hi < n) { sum += vals[hi], ans[k - 1] = hi + 1; if (sum <= 2 * a) { answer(ans); return; } sum -= vals[hi]; } sum += vals[k - 1], ans[k - 1] = k; int base = max(k, hi - k); for (int i = base; i < hi; ++i) { int ind = i - base; sum -= vals[ans[ind] - 1]; sum += vals[i], ans[ind] = i + 1; if (sum >= a) { answer(ans); return; } } impossible(); }

Compilation message (stderr)

books.cpp:2:10: fatal error: books_sample.cpp: No such file or directory
    2 | #include "books_sample.cpp"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.