제출 #977391

#제출 시각아이디문제언어결과실행 시간메모리
977391aykhn전선 연결 (IOI17_wiring)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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