Submission #693352

#TimeUsernameProblemLanguageResultExecution timeMemory
693352BobCompetitiveProgrammingA Difficult(y) Choice (BOI21_books)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <iomanip> #include <cmath> #include <map> #include <set> #include <unordered_set> #include <cstring> #include <queue> #include <array> using namespace std; using ll=int64_t; #define rep(i,n) for(ll i=0; i<ll(n); ++i) #define vi vector<ll> #define all(x) begin(x), end(x) #define pi pair<ll, ll> #include <books.h> // N books, buy K books, difficulty between A and 2A, skims allowed. void solve(int N, int K, ll A, int S){ vector<int> buys; int left=0, right=N+1; while(right-left >=K && S >= 2){ ll mid=(left+right)/2; if(mid+K > N){ if(left) --left; else break; continue; } double avg_diff = (double(skim(mid)) + double(skim(mid+K)))/2.0; S-=2; if(A <= avg_diff && avg_diff <= 2*A){ for(ll i=mid; mid<=mid+K; ++i) buys.push_back(i); answer(buys); } if(avg_diff < A) left=mid; else right=mid; } impossible(); } int main(){ return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccrzRS31.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccyDtOI2.o:books.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccrzRS31.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