/ Vijos /

记录详情

Compile Error

foo.cc: In function 'void add(int, int)':
foo.cc:28:19: error: reference to 'begin' is ambiguous
   28 |  road[++cnt].next=begin[x];
      |                   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from foo.cc:1:
/usr/include/c++/9/valarray:1224:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
 1224 |     begin(const valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/9/valarray:1214:5: note:                 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
In file included from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:87:5: note:                 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
   87 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
   58 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
                 from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/initializer_list:89:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   89 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
foo.cc:11:5: note:                 'int begin [20010]'
   11 | int begin[20010];
      |     ^~~~~
foo.cc:29:2: error: reference to 'begin' is ambiguous
   29 |  begin[x]=cnt;
      |  ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from foo.cc:1:
/usr/include/c++/9/valarray:1224:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
 1224 |     begin(const valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/9/valarray:1214:5: note:                 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
In file included from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:87:5: note:                 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
   87 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
   58 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
                 from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/initializer_list:89:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   89 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
foo.cc:11:5: note:                 'int begin [20010]'
   11 | int begin[20010];
      |     ^~~~~
foo.cc: In function 'void BFS()':
foo.cc:43:13: error: reference to 'begin' is ambiguous
   43 |   for(int j=begin[v];j!=-1;j=road[j].next)
      |             ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from foo.cc:1:
/usr/include/c++/9/valarray:1224:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
 1224 |     begin(const valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/9/valarray:1214:5: note:                 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
In file included from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:87:5: note:                 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
   87 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
   58 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
                 from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/initializer_list:89:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   89 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
foo.cc:11:5: note:                 'int begin [20010]'
   11 | int begin[20010];
      |     ^~~~~
foo.cc:36:6: warning: unused variable 'u' [-Wunused-variable]
   36 |  int u=1;
      |      ^
foo.cc: In function 'int main()':
foo.cc:54:9: error: reference to 'begin' is ambiguous
   54 |  memset(begin,-1,sizeof(begin));
      |         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from foo.cc:1:
/usr/include/c++/9/valarray:1224:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
 1224 |     begin(const valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/9/valarray:1214:5: note:                 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
In file included from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:87:5: note:                 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
   87 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
   58 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
                 from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/initializer_list:89:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   89 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
foo.cc:11:5: note:                 'int begin [20010]'
   11 | int begin[20010];
      |     ^~~~~
foo.cc:54:25: error: reference to 'begin' is ambiguous
   54 |  memset(begin,-1,sizeof(begin));
      |                         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from foo.cc:1:
/usr/include/c++/9/valarray:1224:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
 1224 |     begin(const valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/9/valarray:1214:5: note:                 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
In file included from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:87:5: note:                 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
   87 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
   58 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note:                 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
                 from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/initializer_list:89:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   89 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
foo.cc:11:5: note:                 'int begin [20010]'
   11 | int begin[20010];
      |     ^~~~~
foo.cc:56:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   56 |  scanf("%d%d",&n,&m);
      |  ~~~~~^~~~~~~~~~~~~~
foo.cc:60:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   60 |   scanf("%d%d",&x,&y);
      |   ~~~~~^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1000 A+B Problem
语言
C++
递交时间
2022-03-23 20:04:50
评测时间
2022-03-23 20:04:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes