Submission #639732

# Submission time Handle Problem Language Result Execution time Memory
639732 2022-09-11T10:48:27 Z bonk Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#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

/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