Problem | vainish |
---|---|
User | dzuizz |
Submission Time | 2024-06-19 09:27:52 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
vainish.cpp: In function ‘int main()’:
vainish.cpp:18:19: error: reference to ‘prev’ is ambiguous
18 | c = max(maxi, prev + a[i]), prev = maxi, maxi = c;
| ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
from /usr/include/c++/9/bits/specfun.h:45,
from /usr/include/c++/9/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from vainish.cpp:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:224:5: note: candidates are: ‘template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)’
224 | prev(_BidirectionalIterator __x, typename
| ^~~~
vainish.cpp:5:20: note: ‘long long int prev’
5 | int a[(int)1e6+5], prev;
| ^~~~
vainish.cpp:18:33: er