Problem swords
User zyq69
Submission Time 2023-02-21 08:02:38
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:9:2: error: reference to ‘prev’ is ambiguous
9 | prev = -1;
| ^~~~
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 swords.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
| ^~~~
swords.cpp:5:10: note: ‘int prev’
5 | int ans, prev;
| ^~~~
swords.cpp:18:18: error: reference to ‘prev’ is ambiguous
18 | if(it.second > prev) {
|