제출 #500828

#제출 시각아이디문제언어결과실행 시간메모리
500828beaconmc쌀 창고 (IOI11_ricehub)C++14
컴파일 에러
0 ms0 KiB
using namespace std;typedef long long ll;int besthub(int R,int L,int X[],ll B){ll l=0,h=0,a=1,c=0,z;while(h<R){z=h-l;if(z%2==0 && h!=l)c+=X[h]-X[(z-1)/2+1+l];else c+=X[h]-X[(z-1)/2+l];if(c>B){if(z%2==0)c+=X[l]-X[h];else c+=X[l]-X[h];l++;}else h++;a=max(a, h-l);}return a;}

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

ricehub.cpp: In function 'int besthub(int, int, int*, ll)':
ricehub.cpp:1:250: error: 'max' was not declared in this scope
    1 | using namespace std;typedef long long ll;int besthub(int R,int L,int X[],ll B){ll l=0,h=0,a=1,c=0,z;while(h<R){z=h-l;if(z%2==0 && h!=l)c+=X[h]-X[(z-1)/2+1+l];else c+=X[h]-X[(z-1)/2+l];if(c>B){if(z%2==0)c+=X[l]-X[h];else c+=X[l]-X[h];l++;}else h++;a=max(a, h-l);}return a;}
      |                                                                                                                                                                                                                                                          ^~~