#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define pf push_front
#define pb push_back
#define pi pair<int,int>
#define vi vector<int>
int besthub(int n, int last, vi x, ll b){
int ans = 0;
int l , r;
for(int i = 0; i < n; i++){
l = i - (lower_bound(x.begin(), x.end(), max(0LL,x[i]-b))- x.begin());
r = upper_bound(x.begin(), x.end(), min((ll) last, x[i]+b)) - x.begin() - (i+1);
// cout << x[i] << " " <<l << " " << r << endl;
ans = max(l+r+1,ans);
}
return ans;
}
Compilation message
/usr/bin/ld: /tmp/cc3fxY51.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