Submission #863487

#TimeUsernameProblemLanguageResultExecution timeMemory
863487Ahmed_SolymanA Difficult(y) Choice (BOI21_books)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.cpp" using namespace std; typedef long long ll; // // --- 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. // void solve(int n, int k, long long a, int s) { // TODO implement this function vector<ll>v; for(int i=1;i<=n;i++){ v.push_back(skim(i)); } for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ ll sum=v[i]+v[j]; int z=upper_bound(v.begin(),v.end(),a*2LL-sum)-v.begin(); z--; while(z==i || z==j)k--; if(z<0 || v[i]+v[j]+v[z]<a){ continue; } answer({i+1,j+1,k+1}); return; } } impossible(); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccsP3gTK.o: in function `safely_read_int()':
grader.cpp:(.text+0x0): multiple definition of `safely_read_int()'; /tmp/ccYCWuoH.o:books.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccsP3gTK.o: in function `safely_read_ll()':
grader.cpp:(.text+0x50): multiple definition of `safely_read_ll()'; /tmp/ccYCWuoH.o:books.cpp:(.text+0x50): first defined here
/usr/bin/ld: /tmp/ccsP3gTK.o: in function `answer(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0xa0): multiple definition of `answer(std::vector<int, std::allocator<int> >)'; /tmp/ccYCWuoH.o:books.cpp:(.text+0xa0): first defined here
/usr/bin/ld: /tmp/ccsP3gTK.o: in function `impossible()':
grader.cpp:(.text+0x160): multiple definition of `impossible()'; /tmp/ccYCWuoH.o:books.cpp:(.text+0x160): first defined here
/usr/bin/ld: /tmp/ccsP3gTK.o: in function `skim(int)':
grader.cpp:(.text+0x1a0): multiple definition of `skim(int)'; /tmp/ccYCWuoH.o:books.cpp:(.text+0x1a0): first defined here
/usr/bin/ld: /tmp/ccsP3gTK.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccYCWuoH.o:books.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status