/in/foo.cc: In function 'void add(int, int, int)':
/in/foo.cc:14:2: error: reference to 'next' is ambiguous
next[t]=first[x];
^~~~
/in/foo.cc:8:15: note: candidates are: int next [1000005]
int v[M],w[M],next[M],first[N];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/algorithm:61,
from /in/foo.cc:3:
/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
^~~~
/in/foo.cc: In function 'void getfather(int)':
/in/foo.cc:22:21: error: reference to 'next' is ambiguous
for(i=first[x];i;i=next[i])
^~~~
/in/foo.cc:8:15: note: candidates are: int next [1000005]
int v[M],w[M],next[M],first[N];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/algorithm:61,
from /in/foo.cc:3:
/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
^~~~
/in/foo.cc: In function 'void dfs(int, int)':
/in/foo.cc:56:21: error: reference to 'next' is ambiguous
for(i=first[x];i;i=next[i])
^~~~
/in/foo.cc:8:15: note: candidates are: int next [1000005]
int v[M],w[M],next[M],first[N];
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/algorithm:61,
from /in/foo.cc:3:
/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
^~~~