Submission #639734

# Submission time Handle Problem Language Result Execution time Memory
639734 2022-09-11T10:49:59 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(int r, int l, int 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 + 1);
        }
    }

    return ans;
}

Compilation message

ricehub.cpp:7:4: error: ambiguating new declaration of 'll besthub(int, int, int*, ll)'
    7 | ll besthub(int r, int l, int x[], ll b){
      |    ^~~~~~~
In file included from ricehub.cpp:2:
ricehub.h:1:5: note: old declaration 'int besthub(int, int, int*, long long int)'
    1 | int besthub(int R, int L, int X[], long long B);
      |     ^~~~~~~