답안 #500827

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
500827 2022-01-01T10:48:15 Z beaconmc 쌀 창고 (IOI11_ricehub) C++14
컴파일 오류
0 ms 0 KB
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;}

Compilation message

ricehub.cpp: In function 'int besthub(int, int, int*, ll)':
ricehub.cpp:1:230: error: 'max' was not declared in this scope
    1 | 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;}
      |                                                                                                                                                                                                                                      ^~~