/in/foo.cc: In function 'void add(int, int)':
/in/foo.cc:17:2: error: reference to 'next' is ambiguous
next[cnt]=head[x];
^~~~
/in/foo.cc:8:11: note: candidates are: int next [110000]
int to[N],next[N],head[N],cnt;
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205: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 dfs1(int, int, int)':
/in/foo.cc:24:25: error: reference to 'next' is ambiguous
for(i=head[x],ma=0;i;i=next[i])
^~~~
/in/foo.cc:8:11: note: candidates are: int next [110000]
int to[N],next[N],head[N],cnt;
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205: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 dfs2(int, int)':
/in/foo.cc:37:22: error: reference to 'rank' is ambiguous
top[x]=t,l[x]=++tot,rank[tot]=x;
^~~~
/in/foo.cc:10:22: note: candidates are: int rank [110000]
int son[N],l[N],r[N],rank[N],tot,n;
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/stl_pair.h:59,
from /usr/include/c++/6/utility:70,
from /usr/include/c++/6/algorithm:60,
from /in/foo.cc:3:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
/in/foo.cc:41:20: error: reference to 'next' is ambiguous
for(i=head[x];i;i=next[i])
^~~~
/in/foo.cc:8:11: note: candidates are: int next [110000]
int to[N],next[N],head[N],cnt;
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~