foo.cpp: In function 'void init()':
foo.cpp:26:3: error: reference to 'next' is ambiguous
next[num]=p[x];
^
foo.cpp:14:13: note: candidates are: int next [202000]
int a[N*20],next[N*20],b[N*20],w[N*20],p[N],q[N*20];
^
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++\bits\char_traits.h:39,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
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 'void spfa(int)':
foo.cpp:61:15: error: reference to 'next' is ambiguous
e=next[e];
^
foo.cpp:14:13: note: candidates are: int next [202000]
int a[N*20],next[N*20],b[N*20],w[N*20],p[N],q[N*20];
^
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++\bits\char_traits.h:39,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
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
^