foo.cpp: In function 'void dfs(int, int)':
foo.cpp:17:22: error: reference to 'next' is ambiguous
for (i=first[x];i;i=next[i])
^
foo.cpp:12:21: note: candidates are: int next [602]
int first[N],v[N*2],next[N*2],size[N],g[N],f[N];
^
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++\algorithm:61,
from foo.cpp:1:
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 main()':
foo.cpp:33:4: error: reference to 'next' is ambiguous
next[i]=first[x];
^
foo.cpp:12:21: note: candidates are: int next [602]
int first[N],v[N*2],next[N*2],size[N],g[N],f[N];
^
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++\algorithm:61,
from foo.cpp:1:
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:35:4: error: reference to 'next' is ambiguous
next[i+m]=first[v[i]];
^
foo.cpp:12:21: note: candidates are: int next [602]
int first[N],v[N*2],next[N*2],size[N],g[N],f[N];
^
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++\algorithm:61,
from foo.cpp:1:
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:51:26: error: reference to 'next' is ambiguous
for (i=first[x];i;i=next[i])
^
foo.cpp:12:21: note: candidates are: int next [602]
int first[N],v[N*2],next[N*2],size[N],g[N],f[N];
^
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++\algorithm:61,
from foo.cpp:1:
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
^