Submission #1010813

# Submission time Handle Problem Language Result Execution time Memory
1010813 2024-06-29T11:55:38 Z Muhammet Rice Hub (IOI11_ricehub) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "ricehub.h"
#include "grader.cpp"

#define sz(s) (int)s.size()

using namespace std;

#define ll long long

int besthub(int n, int l, int a[], ll b){
    multiset <ll> s;
    ll ans = 0;
    for(int i = 0; i < n; i++){
        s.clear();
        ll b1 = b, x = 0;
        for(int j = 0; j < n; j++){
            if(a[i] != a[j]){
                s.insert(abs(a[i]-a[j]));
            }
            else x++;
        }
        while(b1 > 0 and sz(s) > 0){
            ll k = *s.begin();
            s.erase(s.begin());
            if(b1 < k) break;
            b1 -= k;
            x++;
        }
        ans = max(ans,x);
    }
    return ans;
}

Compilation message

/usr/bin/ld: /tmp/cc10UA02.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cchrclF1.o:ricehub.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status