답안 #639734

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
639734 2022-09-11T10:49:59 Z bonk 쌀 창고 (IOI11_ricehub) C++14
컴파일 오류
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);
      |     ^~~~~~~