Problem flamethrower
User MagicHenry
Submission Time 2024-07-26 17:05:10
Score 0
Max Time N/A
Max Memory N/A

Compile Error

flamethrower.cpp:4:12: error: array bound is not an integer constant before ‘]’ token
4 | int sum[n+2];
| ^
flamethrower.cpp: In function ‘int main()’:
flamethrower.cpp:10:3: error: ‘sum’ was not declared in this scope
10 | sum[i] = sum[i-1] + a;
| ^~~
flamethrower.cpp:13:4: error: reference to ‘max’ is ambiguous
13 | max = sum[i]-sum[i-3];
| ^~~
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from flamethrower.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:3468:5: note: candidates are: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)’
3468 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/9/bits/stl_algo.h:3462:5: note: ‘template<class _Tp> constexpr _Tp std::max(std::ini