/in/foo.cc: In function 'void putin(int, int)':
/in/foo.cc:13:5: error: reference to 'next' is ambiguous
next[++tot]=last[x];last[x]=tot;to[tot]=y;
^~~~
/in/foo.cc:8:21: note: candidates are: int next [3010000]
int w[N],last[N*10],next[N*10],to[N*10],tot=0,n,m,dfn[N],fa[N],son[N],top[N],size[N],g[N+N+N],deep[N],ans[N];
^~~~
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 dg1(int)':
/in/foo.cc:34:27: error: reference to 'next' is ambiguous
for(int i=last[x];i;i=next[i])
^~~~
/in/foo.cc:8:21: note: candidates are: int next [3010000]
int w[N],last[N*10],next[N*10],to[N*10],tot=0,n,m,dfn[N],fa[N],son[N],top[N],size[N],g[N+N+N],deep[N],ans[N];
^~~~
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 dg2(int)':
/in/foo.cc:46:27: error: reference to 'next' is ambiguous
for(int i=last[x];i;i=next[i])
^~~~
/in/foo.cc:8:21: note: candidates are: int next [3010000]
int w[N],last[N*10],next[N*10],to[N*10],tot=0,n,m,dfn[N],fa[N],son[N],top[N],size[N],g[N+N+N],deep[N],ans[N];
^~~~
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 lct(int, int)':
/in/foo.cc:60:20: warning: unused variable 'bz' [-Wunused-variable]
int z=lca(x,y),bz=1;
^~