watching.cpp: In function 'bool ok(int)':
watching.cpp:13:9: error: reference to 'prev' is ambiguous
prev[0][i] = upper_bound(arr,arr+i,arr[i]-w)-arr-1;
^
watching.cpp:6:5: note: candidates are: int prev [2][2100]
int prev[2][2100];
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:66:0,
from /usr/include/c++/5/bits/char_traits.h:39,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
prev(_BidirectionalIterator __x, typename
^
watching.cpp:14:9: error: reference to 'prev' is ambiguous
prev[1][i] = upper_bound(arr,arr+i,arr[i]-w*2)-arr-1;
^
watching.cpp:6:5: note: candidates are: int prev [2][2100]
int prev[2][2100];
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:66:0,
from /usr/include/c++/5/bits/char_traits.h:39,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
prev(_BidirectionalIterator __x, typename
^
watching.cpp:18:38: error: reference to 'prev' is ambiguous
dyn[i][j] = min(((j)?dyn[prev[1][i]][j-1]:987654321),dyn[prev[0][i]][j]+1);
^
watching.cpp:6:5: note: candidates are: int prev [2][2100]
int prev[2][2100];
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:66:0,
from /usr/include/c++/5/bits/char_traits.h:39,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
prev(_BidirectionalIterator __x, typename
^
watching.cpp:18:70: error: reference to 'prev' is ambiguous
dyn[i][j] = min(((j)?dyn[prev[1][i]][j-1]:987654321),dyn[prev[0][i]][j]+1);
^
watching.cpp:6:5: note: candidates are: int prev [2][2100]
int prev[2][2100];
^
In file included from /usr/include/c++/5/bits/stl_algobase.h:66:0,
from /usr/include/c++/5/bits/char_traits.h:39,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:193:5: note: template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
prev(_BidirectionalIterator __x, typename
^
watching.cpp: In function 'int main()':
watching.cpp:26:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d",&n,&p,&q);
^
watching.cpp:28:43: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (i=1;i<=n;i++) scanf("%d",&arr[i]);
^