/in/foo.cc: In function 'int bfs()':
/in/foo.cc:26:1: error: reference to 'next' is ambiguous
next=head-1;
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:28:1: error: reference to 'next' is ambiguous
next=head+1;
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:30:1: error: reference to 'next' is ambiguous
next=2*head;
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:31:4: error: reference to 'next' is ambiguous
if(next>N||next<0) //estimate whether slop over,if so,don't concern it
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:31:12: error: reference to 'next' is ambiguous
if(next>N||next<0) //estimate whether slop over,if so,don't concern it
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:33:7: error: reference to 'next' is ambiguous
if(!v[next]){
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:34:8: error: reference to 'next' is ambiguous
q.push(next); //push the node into queue
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:35:3: error: reference to 'next' is ambiguous
s[next]=s[head]+1; //mark for visited
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:36:3: error: reference to 'next' is ambiguous
v[next]=1;
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:38:4: error: reference to 'next' is ambiguous
if(next==k) //find the goal, then quit
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:39:10: error: reference to 'next' is ambiguous
return s[next];
^~~~
/in/foo.cc:10:14: note: candidates are: int next
int n,k,head,next;
^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c