Submission #1003095

# Submission time Handle Problem Language Result Execution time Memory
1003095 2024-06-20T06:02:42 Z vjudge1 Rice Hub (IOI11_ricehub) C++17
Compilation error
0 ms 0 KB
#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>


ll besthub(int n, int last, vi x, int b){
    
    
    int prev, op;
    ll l,r;
    ll ans = 0;
    for(int i = 0; i < n; i++){
        
        l = i - (lower_bound(x.begin(), x.end(), max(0,x[i]-b))- x.begin());
        r =  upper_bound(x.begin(), x.end(), min(last, x[i]+b)) - x.begin() - (i+1);
       // cout << x[i] << " " <<l << " " << r << endl;
        ans = max(l+r+1,ans);
    }
    
    return ans;
    
    
    
    
}

Compilation message

ricehub.cpp: In function 'long long int besthub(int, int, std::vector<int>, int)':
ricehub.cpp:15:9: warning: unused variable 'prev' [-Wunused-variable]
   15 |     int prev, op;
      |         ^~~~
ricehub.cpp:15:15: warning: unused variable 'op' [-Wunused-variable]
   15 |     int prev, op;
      |               ^~
/usr/bin/ld: /tmp/ccVgb6jD.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