제출 #1021488

#제출 시각아이디문제언어결과실행 시간메모리
1021488j_vdd16비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
int count_tastiness(int x, vi a) { constexpr int N = 60; while (a.size() < N) a.push_back(0); for (int i = 1; i < N; i++) a[i] *= (1LL << i); vi values = { 0 }; for (int bit = 0; bit < N; bit++) { int sz = values.size(); loop(i, sz) { int& count = values[i]; count += a[bit]; if (count / (1LL << bit) >= x) values.push_back(count - x * (1LL << bit)); } } return values.size(); }

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

biscuits.cpp:1:28: error: 'vi' has not been declared
    1 | int count_tastiness(int x, vi a)
      |                            ^~
biscuits.cpp: In function 'int count_tastiness(int, int)':
biscuits.cpp:4:11: error: request for member 'size' in 'a', which is of non-class type 'int'
    4 |  while (a.size() < N)
      |           ^~~~
biscuits.cpp:5:5: error: request for member 'push_back' in 'a', which is of non-class type 'int'
    5 |   a.push_back(0);
      |     ^~~~~~~~~
biscuits.cpp:8:4: error: invalid types 'int[int]' for array subscript
    8 |   a[i] *= (1LL << i);
      |    ^
biscuits.cpp:10:2: error: 'vi' was not declared in this scope
   10 |  vi values = { 0 };
      |  ^~
biscuits.cpp:13:12: error: 'values' was not declared in this scope
   13 |   int sz = values.size();
      |            ^~~~~~
biscuits.cpp:14:8: error: 'i' was not declared in this scope
   14 |   loop(i, sz) {
      |        ^
biscuits.cpp:14:3: error: 'loop' was not declared in this scope
   14 |   loop(i, sz) {
      |   ^~~~
biscuits.cpp:23:9: error: 'values' was not declared in this scope
   23 |  return values.size();
      |         ^~~~~~