foo.cpp: In function 'void AddEdge(int, int, int)':
foo.cpp:20:24: error: reference to 'next' is ambiguous
to[++e]=v;dis[e]=w;next[e]=first[u];first[u]=e;
^
foo.cpp:18:21: note: candidates are: int next [600020]
int n,m,first[maxn],next[maxn<<1],to[maxn<<1],dis[maxn<<1],e;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\deque:60,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\queue:60,
from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^
foo.cpp:21:24: error: reference to 'next' is ambiguous
to[++e]=u;dis[e]=w;next[e]=first[v];first[v]=e;
^
foo.cpp:18:21: note: candidates are: int next [600020]
int n,m,first[maxn],next[maxn<<1],to[maxn<<1],dis[maxn<<1],e;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\deque:60,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\queue:60,
from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^
foo.cpp: In function 'void dfs(int)':
foo.cpp:9:36: error: reference to 'next' is ambiguous
#define ren for(int i=first[x];i;i=next[i])
^
foo.cpp:26:5: note: in expansion of macro 'ren'
ren if(to[i]!=fa[x]) {
^
foo.cpp:18:21: note: candidates are: int next [600020]
int n,m,first[maxn],next[maxn<<1],to[maxn<<1],dis[maxn<<1],e;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\deque:60,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\queue:60,
from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^
foo.cpp: In function 'void build(int, int)':
foo.cpp:9:36: error: reference to 'next' is ambiguous
#define ren for(int i=first[x];i;i=next[i])
^
foo.cpp:35:5: note: in expansion of macro 'ren'
ren if(to[i]!=fa[x]&&to[i]!=son[x]) build(to[i],to[i]);
^
foo.cpp:18:21: note: candidates are: int next [600020]
int n,m,first[maxn],next[maxn<<1],to[maxn<<1],dis[maxn<<1],e;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\deque:60,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\queue:60,
from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^
foo.cpp: In function 'int dfs2(int)':
foo.cpp:9:36: error: reference to 'next' is ambiguous
#define ren for(int i=first[x];i;i=next[i])
^
foo.cpp:47:5: note: in expansion of macro 'ren'
ren if(to[i]!=fa[x]) cnt[x]+=dfs2(to[i]);
^
foo.cpp:18:21: note: candidates are: int next [600020]
int n,m,first[maxn],ne