Submission #465406

#TimeUsernameProblemLanguageResultExecution timeMemory
465406pdstiago쌀 창고 (IOI11_ricehub)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define mxn 505
#define mxm 105
#define f first
#define s second
#define pb push_back
#define es " "
#define endl '\n'
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define ll long long
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
typedef pair<string, string> pii;
typedef pair<int, pii> pip;

int resp;

int testa(int x, int n, int b, int v[]){
    int can=0, soma=0;
    vector<int> pont;
    for(int i=1; i<=n; i++){
        pont.pb(abs(x-v[i]));
    }
    sort(all(pont));
    for(int i:pont){
        if(soma+i<=b){
            soma+=i;
            can++;
        }
    }
    return can;
}

int besthub(int n, int l, int v[], int b){
    for(int i=1; i<=l; i++){
        resp=max(resp, testa(i, n, b, v));
    }
    return resp;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccogSCTw.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