/in/foo.cc: In function 'int search()':
/in/foo.cc:12:10: error: reference to 'end' is ambiguous
if(p==end)break;
^~~
/in/foo.cc:5:26: note: candidates are: int end
int d[200001]={0},start,end;//d[]代表走到当前点需要的最少步数
^~~
In file included from /usr/include/c++/7/string:51:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^~~
/usr/include/c++/7/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^~~
/usr/include/c++/7/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^~~
In file included from /usr/include/c++/7/bits/range_access.h:36:0,
from /usr/include/c++/7/string:51,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^~~
/in/foo.cc:17:11: error: 'n' was not declared in this scope
if(p<n&&d[p]+1<d[p+1]){//若小于n才能+1
^
/in/foo.cc:27:12: error: reference to 'end' is ambiguous
return d[end];
^~~
/in/foo.cc:5:26: note: candidates are: int end
int d[200001]={0},start,end;//d[]代表走到当前点需要的最少步数
^~~
In file included from /usr/include/c++/7/string:51:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^~~
/usr/include/c++/7/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^~~
/usr/include/c++/7/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^~~
In file included from /usr/include/c++/7/bits/range_access.h:36:0,
from /usr/include/c++/7/string:51,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:31:14: error: reference to 'end' is ambiguous
cin>>start>>end;
^~~
/in/foo.cc:5:26: note: candidates are: int end
int d[200001]={0},start,end;//d[]代表走到当前点需要的最少步数
^~~
In file included from /usr/include/c++/7/string:51:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^~~
/usr/include/c++/7/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^~~
/usr/include/c++/7/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^~~
In file included from /usr/include/c++/7/bits/range_access.h:36:0,
from /usr/include/c++/7/string:51,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/7/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^~~