Problem prefixsums
User dieunq1309
Submission Time 2023-04-19 09:32:05
Score 0
Max Time N/A
Max Memory N/A

Compile Error

prefixsums.cpp: In function ‘int main()’:
prefixsums.cpp:18:9: error: expected ‘,’ or ‘;’ before ‘cout’
18 | cout << sum << endl;
| ^~~~
In file included from /usr/include/c++/9/numeric:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:84,
from prefixsums.cpp:1:
/usr/include/c++/9/bits/stl_numeric.h: In instantiation of ‘_Tp std::accumulate(_InputIterator, _InputIterator, _Tp) [with _InputIterator = int; _Tp = int]’:
prefixsums.cpp:17:55: required from here
/usr/include/c++/9/bits/stl_numeric.h:139:41: error: invalid type argument of unary ‘*’ (have ‘int’)
139 | __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
| ^~~~~~~~