/in/foo.cc: In function 'int search()':
/in/foo.cc:85:8: error: reference to 'prev' is ambiguous
int x=prev[n];
^~~~
/in/foo.cc:20:5: note: candidates are: int prev [1005]
int prev[1005];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:217:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
prev(_BidirectionalIterator __x, typename
^~~~
/in/foo.cc:95:5: error: reference to 'prev' is ambiguous
x=prev[y];
^~~~
/in/foo.cc:20:5: note: candidates are: int prev [1005]
int prev[1005];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:217:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
prev(_BidirectionalIterator __x, typename
^~~~