Submission #409892

# Submission time Handle Problem Language Result Execution time Memory
409892 2021-05-21T18:36:14 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(ll n, ll m, ll 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

/usr/bin/ld: /tmp/cc4eIRbk.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccO2pNtl.o:ricehub.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccO2pNtl.o: in function `main':
ricehub.cpp:(.text.startup+0xae): undefined reference to `besthub(int, int, int*, long long)'
/usr/bin/ld: /tmp/cc4eIRbk.o: in function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `besthub(int, int, int*, long long)'
collect2: error: ld returned 1 exit status