foo.cpp: In function 'void add(int, int)':
foo.cpp:9:2: error: reference to 'next' is ambiguous
next[++sz]=fir[x];fir[x]=sz;to[sz]=y;
^
foo.cpp:6:40: note: candidates are: int next [400001]
int n,w[200001],fir[200001],to[400001],next[400001],sz,ans1,ans2;
^
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:2:
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:10:2: error: reference to 'next' is ambiguous
next[++sz]=fir[y];fir[y]=sz;to[sz]=x;
^
foo.cpp:6:40: note: candidates are: int next [400001]
int n,w[200001],fir[200001],to[400001],next[400001],sz,ans1,ans2;
^
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:2:
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:26:24: error: reference to 'next' is ambiguous
for(int j=fir[i];j;j=next[j])
^
foo.cpp:6:40: note: candidates are: int next [400001]
int n,w[200001],fir[200001],to[400001],next[400001],sz,ans1,ans2;
^
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:2:
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
^