제출 #639734

#제출 시각아이디문제언어결과실행 시간메모리
639734bonk쌀 창고 (IOI11_ricehub)C++14
컴파일 에러
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;
}

컴파일 시 표준 에러 (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);
      |     ^~~~~~~