Submission #639732

#TimeUsernameProblemLanguageResultExecution timeMemory
639732bonkRice Hub (IOI11_ricehub)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <ricehub.h> using namespace std; using ll = long long; ll besthub(ll r, ll l, ll x[], ll b){ ll ans = 0; for(ll i = 0; i < r; i++){ ll cur = 0; for(ll j = i; j < r; j++){ cur += x[j]; ll mid = cur/(j - i + 1); ll cost = 0; for(ll k = i; k <= j; k++){ cost += abs(x[k] - mid); } if(cost <= b) ans = max(ans, j - i + 1LL); } } return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccXO9ZhA.o: in function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `besthub(int, int, int*, long long)'
collect2: error: ld returned 1 exit status