foo.cpp: In function 'bool bfs()':
foo.cpp:29:38: error: reference to 'next' is ambiguous
for(i=first[x];i!=-1;i=next[i])
^
foo.cpp:10:33: note: candidates are: long int next [330010]
long u[maxm],v[maxm],w[maxm],next[maxm];
^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:1:
c:\tdm-gcc-32\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:20:21: warning: unused variable 'tmp' [-Wunused-variable]
long i,p,q,x,tmp,pos;
^
foo.cpp:21:13: warning: unused variable 'ans' [-Wunused-variable]
long ans;
^
foo.cpp: In function 'long int dfs(long int, long int)':
foo.cpp:52:35: error: reference to 'next' is ambiguous
for(i=first[x];i!=-1;i=next[i])
^
foo.cpp:10:33: note: candidates are: long int next [330010]
long u[maxm],v[maxm],w[maxm],next[maxm];
^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:1:
c:\tdm-gcc-32\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:90:13: error: reference to 'next' is ambiguous
next[tot]=first[u[tot]];
^
foo.cpp:10:33: note: candidates are: long int next [330010]
long u[maxm],v[maxm],w[maxm],next[maxm];
^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:1:
c:\tdm-gcc-32\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:97:13: error: reference to 'next' is ambiguous
next[tot]=first[u[tot]];
^
foo.cpp:10:33: note: candidates are: long int next [330010]
long u[maxm],v[maxm],w[maxm],next[maxm];
^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from