watching.cpp: In function 'bool ok(int)':
watching.cpp:34:9: error: reference to 'next' is ambiguous
next[0][i] = busca2(num[i]+w-1), next[1][i] = busca2(num[i]+2*w-1);
^~~~
watching.cpp:9:41: note: candidates are: int next [2][2010]
int n, p, q, num[MAXN], dp[MAXN][MAXN], next[2][MAXN];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
watching.cpp:34:42: error: reference to 'next' is ambiguous
next[0][i] = busca2(num[i]+w-1), next[1][i] = busca2(num[i]+2*w-1);
^~~~
watching.cpp:9:41: note: candidates are: int next [2][2010]
int n, p, q, num[MAXN], dp[MAXN][MAXN], next[2][MAXN];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
watching.cpp:41:42: error: reference to 'next' is ambiguous
dp[i][j] = max(dp[i][j], next[0][min(n, dp[i-1][j]+1)]);
^~~~
watching.cpp:9:41: note: candidates are: int next [2][2010]
int n, p, q, num[MAXN], dp[MAXN][MAXN], next[2][MAXN];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
watching.cpp:43:42: error: reference to 'next' is ambiguous
dp[i][j] = max(dp[i][j], next[1][min(n, dp[i][j-1]+1)]);
^~~~
watching.cpp:9:41: note: candidates are: int next [2][2010]
int n, p, q, num[MAXN], dp[MAXN][MAXN], next[2][MAXN];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from watching.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
watching.cpp: In function 'int main()':
watching.cpp:64:10: 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:66:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i = 1; i <= n; i++) scanf("%d", &num[i]);
~~~~~^~~~~~~~~~~~~~~