제출 #1003100

#제출 시각아이디문제언어결과실행 시간메모리
1003100vjudge1쌀 창고 (IOI11_ricehub)C++17
컴파일 에러
0 ms0 KiB
int besthub(int n, int last, int x[], ll b){
    

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

}

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

ricehub.cpp:1:39: error: 'll' has not been declared
    1 | int besthub(int n, int last, int x[], ll b){
      |                                       ^~
ricehub.cpp: In function 'int besthub(int, int, int*, int)':
ricehub.cpp:8:40: error: 'max' was not declared in this scope
    8 |         l = i - (lower_bound(x, x + n, max(0LL,x[i]-b))- x);
      |                                        ^~~
ricehub.cpp:8:18: error: 'lower_bound' was not declared in this scope
    8 |         l = i - (lower_bound(x, x + n, max(0LL,x[i]-b))- x);
      |                  ^~~~~~~~~~~
ricehub.cpp:9:41: error: 'll' was not declared in this scope; did you mean 'l'?
    9 |         r =  (upper_bound(x, x +n, min((ll) last, x[i]+b)) -x) - (i+1);
      |                                         ^~
      |                                         l
ricehub.cpp:9:36: error: 'min' was not declared in this scope
    9 |         r =  (upper_bound(x, x +n, min((ll) last, x[i]+b)) -x) - (i+1);
      |                                    ^~~
ricehub.cpp:9:15: error: 'upper_bound' was not declared in this scope
    9 |         r =  (upper_bound(x, x +n, min((ll) last, x[i]+b)) -x) - (i+1);
      |               ^~~~~~~~~~~