foo.cpp: In function 'void readfile()':
foo.cpp:17:5: error: reference to 'next' is ambiguous
next[i]=first[u[i]];
^
foo.cpp:6:26: note: candidates are: long long int next [200001]
long long n,first[maxnn],next[maxnn],u[maxnn],v[maxnn],w[maxnn],i,j,x,y,ing[maxnn],po,sum=0,maxn=0,link[maxnn];
^
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:19:5: error: reference to 'next' is ambiguous
next[i+n-1]=first[u[i+n-1]];
^
foo.cpp:6:26: note: candidates are: long long int next [200001]
long long n,first[maxnn],next[maxnn],u[maxnn],v[maxnn],w[maxnn],i,j,x,y,ing[maxnn],po,sum=0,maxn=0,link[maxnn];
^
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 slove2()':
foo.cpp:36:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
if(ing[i]=1){po=i;break;}
^
foo.cpp:42:29: error: reference to 'next' is ambiguous
for(j=first[po];j!=-1;j=next[j])
^
foo.cpp:6:26: note: candidates are: long long int next [200001]
long long n,first[maxnn],next[maxnn],u[maxnn],v[maxnn],w[maxnn],i,j,x,y,ing[maxnn],po,sum=0,maxn=0,link[maxnn];
^
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
^