Problem packingducks
User chiefoggy
Submission Time 2024-07-08 21:22:32
Score 0
Max Time N/A
Max Memory N/A

Compile Error

packingducks.cpp: In function ‘int main()’:
packingducks.cpp:11:13: error: request for member ‘push_back’ in ‘sums.std::vector<int>::operator[](0)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
11 | sums[0].push_back(0);
| ^~~~~~~~~
packingducks.cpp:14:30: error: ‘begin’ was not declared in this scope
14 | for (int y : sums[i-1]){
| ^
packingducks.cpp:14:30: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from packingducks.cpp:1:
/usr/include/c++/9/valarray:1224:5: note: ‘std::begin’
1224 | begin(const valarray<_Tp>& __va)
| ^~~~~
In file included from /usr/include/c++/9/filesystem:38,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:129,
from packingducks.cpp