Submission #639734

#TimeUsernameProblemLanguageResultExecution timeMemory
639734bonkRice 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(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 (stderr)

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);
      |     ^~~~~~~