Problem pushups
User supercel980
Submission Time 2025-02-10 17:54:40
Score 0
Max Time N/A
Max Memory N/A

Compile Error

pushups.cpp: In function ‘int main()’:
pushups.cpp:15:12: error: no match for ‘operator+=’ (operand types are ‘std::vector<int>’ and ‘int’)
15 | ans[j]+=k;
| ~~~~~~^~~
pushups.cpp:19:26: error: no matching function for call to ‘max_element(std::vector<int> [(n + 1)])’
19 | cout << max_element(ans) << "\n"
| ^
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from pushups.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:5713:5: note: candidate: ‘template<class _FIter> constexpr _FIter std::max_element(_FIter, _FIter)’
5713 | max_element(_ForwardIterator __first, _ForwardIterator __last)
| ^~~~~~~~~~~
/usr/include/c++/9/bits/stl_algo.h:5713:5: note: template argument deduction/substitution failed:
pushups.cpp:19:26: note: candidate expects 2 arguments, 1