Submission #1110228

# Submission time Handle Problem Language Result Execution time Memory
1110228 2024-11-09T02:51:55 Z dung3683833 Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 +5 ;
int a[N];
signed main() {
    int n, l, k;
    cin >> n >> l >> k;
    for (int i = 1; i <= n; i++) cin >> a[i];
    // sort(a+1, a+n+1);
    int ma = 0;
    for (int i = 1; i <= n; i++) {
        int pos = upper_bound(a+i+1, a+n+1, a[i] + k) - a - 1;
        ma = max(ma, pos - i + 1);
    }
    cout << ma;
    return 0;
}

Compilation message

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