Submission #977391

#TimeUsernameProblemLanguageResultExecution timeMemory
977391aykhnWiring (IOI17_wiring)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int l = 0; int r = 1000000000; int best = 0; while (l <= r) { int mid = (l + r)/2; int c = 0; if (mid == 0) {cout << 0 << endl; return 0;} for (int i = 0; i < n; i++) { c += a[i]/mid; } if (c >= m) { best = max(best, mid); l = mid + 1; } else r = mid - 1; } cout << best; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccNimJmT.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccXdWduT.o:wiring.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccNimJmT.o: in function `main':
grader.cpp:(.text.startup+0x23a): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status