foo.cc: In function 'int main()':
foo.cc:75:17: error: reference to 'end' is ambiguous
75 | Dfront=_max,end=id;//求出造第一条路时的树的直径——Dfront
| ^~~
In file included from stdc++.h:95:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1253:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1253 | end(const valarray<_Tp>& __va) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1237:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1237 | end(valarray<_Tp>& __va) noexcept
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:100:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
100 | end(_Tp (&__arr)[_Nm]) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:81:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:71:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:36,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/initializer_list:101:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:19:41: note: 'int end'
19 | int len,x,y,_max,id,Dfront,Dafter,start,end,fr[maxn]={},dis[maxn]={};
| ^~~
foo.cc:80:23: error: reference to 'end' is ambiguous
80 | dfs_for_D(start,0,end);//记录直径——Dfront上的点
| ^~~
In file included from stdc++.h:95:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1253:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1253 | end(const valarray<_Tp>& __va) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1237:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1237 | end(valarray<_Tp>& __va) noexcept
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:100:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
100 | end(_Tp (&__arr)[_Nm]) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:81:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:71:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:36,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/initializer_list:101:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:19:41: note: 'int end'
19 | int len,x,y,_max,id,Dfront,Dafter,start,end,fr[maxn]={},dis[maxn]={};
| ^~~
foo.cc:81:11: error: reference to 'end' is ambiguous
81 | __map[end]=1;
| ^~~
In file included from stdc++.h:95:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1253:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1253 | end(const valarray<_Tp>& __va) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1237:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1237 | end(valarray<_Tp>& __va) noexcept
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:100:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
100 | end(_Tp (&__arr)[_Nm]) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:81:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:71:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:36,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/initializer_list:101:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:19:41: note: 'int end'
19 | int len,x,y,_max,id,Dfront,Dafter,start,end,fr[maxn]={},dis[maxn]={};
| ^~~
foo.cc:83:24: error: reference to 'end' is ambiguous
83 | for(int i=start;i!=end;i=fr[i])
| ^~~
In file included from stdc++.h:95:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1253:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1253 | end(const valarray<_Tp>& __va) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/valarray:1237:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1237 | end(valarray<_Tp>& __va) noexcept
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:100:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
100 | end(_Tp (&__arr)[_Nm]) noexcept
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:81:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
81 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:71:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
71 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/range_access.h:36,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/string:54,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/istream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/sstream:38,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/complex:45,
from /nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/ccomplex:39,
from stdc++.h:54:
/nix/store/jdc41bl531bw84wi82y6gvij34q5m24a-gcc-11.3.0/include/c++/11.3.0/initializer_list:101:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
101 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:19:41: note: 'int end'
19 | int len,x,y,_max,id,Dfront,Dafter,start,end,fr[maxn]={},dis[maxn]={};
| ^~~
正在同步测试数据,请稍后
Found 12 testcases.
[Hydro](https://hydro.ac)提供评测服务