/in/foo.cc: In function 'void AddEdge(int, int)':
/in/foo.cc:12:5: error: reference to 'next' is ambiguous
next[e]=first[U];
^~~~
/in/foo.cc:8:21: note: candidates are: int next [50001]
int e,v[M],first[N],next[M];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:32:30: error: reference to 'next' is ambiguous
for(int j=first[i];j;j=next[j])
^~~~
/in/foo.cc:8:21: note: candidates are: int next [50001]
int e,v[M],first[N],next[M];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:39:30: error: reference to 'next' is ambiguous
for(int j=first[i];j;j=next[j])
^~~~
/in/foo.cc:8:21: note: candidates are: int next [50001]
int e,v[M],first[N],next[M];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/algorithm:61,
from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:42:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'll {aka long long int}' [-Wformat=]
printf("%d\n",ans);
^