제출 #227783

#제출 시각아이디문제언어결과실행 시간메모리
227783staniewzki쌀 창고 (IOI11_ricehub)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; using LL = long long; #include "ricehub.h" int besthub(int R, int L, int X[], LL B) { vector<LL> sum(R + 1); for(int i = 0; i < R; i++) sum[i + 1] = sum[i] + X[i]; auto get = [&](int l, int r) { int m = (l + r) / 2; return sum[r + 1] - sum[m] - X[m] * (r + 1 - m) + X[m] * (m - l) - sum[m] + sum[l]; }; for(int i = 0; i < R; i++) REP(i, R) while(p < R && get(i, p) <= B) ans = max(ans, p++ - i + 1); return ans; }

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

ricehub.cpp: In function 'int besthub(int, int, int*, LL)':
ricehub.cpp:20:2: error: 'REP' was not declared in this scope
  REP(i, R)
  ^~~
ricehub.cpp:23:9: error: 'ans' was not declared in this scope
  return ans;
         ^~~
ricehub.cpp:23:9: note: suggested alternative: 'abs'
  return ans;
         ^~~
         abs