Submission #787764

#TimeUsernameProblemLanguageResultExecution timeMemory
787764fabijan_cikacA Difficult(y) Choice (BOI21_books)C++17
Compilation error
0 ms0 KiB
#include "books.h" #include <bits/stdc++.h> using namespace std; #define pp pair<int, ll> #define F first #define S second #define ll long long #define pb push_back void solve(int N, int K, ll A, int S){ int l = 1, r = N; while (l < r){ int mid = (l + r - 1) / 2; if (skim(mid) >= A) r = mid; else l = mid + 1; } vector<pp> v; for (int i = 1; i <= min(K, l - K); ++i) v.pb({i, skim(i)}); for (int i = max(K + 1, l - K + 1); i <= l; ++i) v.pb({i, skim(i)}); for (int i = 0; i < (1 << (int)(v.size())); ++i){ if (__builtin_popcount(i) != K) continue; ll sum = 0; for (int j = 0; j < (int)(v.size()); ++j){ if (i & (1 << j)) sum += v[j].S; } if (sum >= A && sum <= 2 * A){ vector<int> ans; for (int j = 0; j < (int)(v.size()); ++j){ if (i & (1 << j)) ans.pb(v[j].F); } sort(ans.begin(), ans.end()); answer(ans); } } impossible(); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccQtRITd.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc4RdaUe.o:books.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status