Submission #409893

# Submission time Handle Problem Language Result Execution time Memory
409893 2021-05-21T18:37:46 Z Dan4Life Rice Hub (IOI11_ricehub) C++17
Compilation error
0 ms 0 KB
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll besthub(int n, int m, int a[], ll k)
{
    ll ans = 0;
    for(int i = 0; i < n; i++){
        multiset<int> S; S.clear();
        for(int j = 0; j < n; j++)
            S.insert(abs(a[i]-a[j]));
        ll K = k, cnt = 0;
        while(!S.empty() and K>=(*S.begin()))
            cnt++, K-=(*S.begin()), S.erase(S.begin());
        if(ans<cnt)ans=cnt;
    }
    return ans;
}

Compilation message

ricehub.cpp:6:4: error: ambiguating new declaration of 'long long int besthub(int, int, int*, long long int)'
    6 | ll besthub(int n, int m, int a[], ll k)
      |    ^~~~~~~
In file included from grader.cpp:1,
                 from ricehub.cpp:1:
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);
      |     ^~~~~~~