Submission #529744

#TimeUsernameProblemLanguageResultExecution timeMemory
529744c28dnv9q3Monster Game (JOI21_monster)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> template<typename F> int binsearch(int low, int high, F f) { if(f(low)) { return low; } while(high > low+1) { int m = (low + high) / 2; if(f(m)) { high = m; } else { low = m; } } return high; } int main() { int n; int m; std::cin >> n; std::cin >> m; std::vector<int> a(m); for(int i = 0; i < m; i++) { std::cin >> a[i]; } std::cout << binsearch(1, 1000000005, [&] (int x) { int j = 0; for(int i = 0; i < m; i++) { j += std::ceil((float)a[i]/x); } return j <= n; }); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccnEiHiq.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccwfHYcq.o:monster.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccnEiHiq.o: in function `main':
stub.cpp:(.text.startup+0xb3): undefined reference to `Solve(int)'
collect2: error: ld returned 1 exit status