제출 #1327705

#제출 시각아이디문제언어결과실행 시간메모리
1327705arman.khachatryan쌀 창고 (IOI11_ricehub)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
const int R=5010, L=1e6+10;
int main() {
    int r, l, b;
    cin>>r>>l>>b;
    int a[r];
    for(int i=0; i<r; i++){
        cin>>a[i];
    }
    int j, k, c, ans=0, cnt;
    for(int i=0; i<r; i++){
        j=i-1;
        k=i+1;
        cnt=0;
        c=b;
        while(c>0){
            if(0<=j && (k>=r || a[i]-a[j]<=a[k]-a[i])){
                j--;
                cnt++;
                c-=a[i]-a[j];
            }else if(k<r && (j<0 || a[i]-a[j]>=a[k]-a[i])){
                k++;
                cnt++;
                c-=a[k]-a[i];
            }
        }
        ans=max(ans, cnt);
    }
    cout<<ans+1;
}

컴파일 시 표준 에러 (stderr) 메시지

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