제출 #991034

#제출 시각아이디문제언어결과실행 시간메모리
991034stdfloat쌀 창고 (IOI11_ricehub)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "ricehub.h" #include "grader.cpp" using namespace std; using ll = long long; int besthub(int n, int L, int X[], ll B) { vector<ll> p(n); for (int i = 0; i < n; i++) p[i] = (i ? p[i - 1] : 0) + X[i]; int mx = 0; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { int x = (j - i) >> 1; if ((i & 1) == (j & 1)) { if ((ll)(x + 1) * X[i + x] - p[i + x] + (i ? p[i - 1] : 0) + p[j] - p[i + x] - (ll)x * X[i + x] > B) break; } else { int y = (X[i + x] + X[i + x + 1]) >> 1; if ((ll)(x + 1) * y - p[i + x] + (i ? p[i - 1] : 0) + p[j] - p[i + x] - (ll)(x + 1) * y > B) break; } mx = max(mx, j - i + 1); } } return mx; }

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccxq5wJ8.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccbbfst5.o:ricehub.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status