답안 #1048671

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1048671 2024-08-08T09:00:55 Z AndreasK 쌀 창고 (IOI11_ricehub) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

#define designed ios_base::sync_with_stdio(0);
#define by cin.tie(0);
#define AndreasK cout.tie(0);
#define int long long
#define ii pair <int,int>
#define vi vector <int>
#define iii pair <int,ii>
#define vii vector <ii>
#define vc vector <char>
#define vb vector <bool>

int answer(int R,int L,int X[],int B){
    int mx=0;
    for (int c=1;c<=L;c++){
        vi a;
        for (int r=0;r<R;r++)
            a.push_back(abs(X[r]-c));
        sort(a.begin(),a.end());
        int ttl=0;
        int b=B;
        for (int r=0;r<R;r++){
            if (a[r]<=b){
                b-=a[r];
                ttl++;
            }
        }
        mx=max(mx,ttl);
    }
    return mx;
}

int32_t main(){
    designed by AndreasK

return 0;}

Compilation message

/usr/bin/ld: /tmp/ccNxi4X0.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccelSnV1.o:ricehub.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccNxi4X0.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