답안 #1003164

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1003164 2024-06-20T07:02:06 Z vjudge1 쌀 창고 (IOI11_ricehub) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "ricehub.h"
#define ll long long
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define f first
#define s second
#define pb push_back
#define p_b pop_back
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
    int res = 0;
    for(int i = 0; i < R; i++)
    {
        int g = 0;
        for(int j = i; j < R; j++)
        {
            g += (X[j] - X[i]);
            if(g - 1 > B)
                break;
            res = max(res, j - i + 1);
        }
    }
    return res;
}
int main()
{
    int R, L;
    ll B;
    cin >> R >> L >> B;
    int X[R];
    for(int i = 0; i < R; i++)
        cin >> X[i];
    cout << besthub(R, L, X, B) << "\n";
}

Compilation message

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