/ OPS /

记录详情

Compile Error

In file included from /usr/include/c++/9/vector:67,
                 from /usr/include/c++/9/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
                 from /in/foo.cc:1:
/usr/include/c++/9/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>':
/usr/include/c++/9/bits/stl_vector.h:386:11:   required from 'class std::vector<int, int>'
/in/foo.cc:13:18:   required from here
/usr/include/c++/9/bits/stl_vector.h:84:21: error: 'int' is not a class, struct, or union type
   84 |  rebind<_Tp>::other _Tp_alloc_type;
      |                     ^~~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:86:9: error: 'int' is not a class, struct, or union type
   86 |         pointer;
      |         ^~~~~~~
/usr/include/c++/9/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>':
/in/foo.cc:13:18:   required from here
/usr/include/c++/9/bits/stl_vector.h:387:5: error: 'int' is not a class, struct, or union type
  387 |     {
      |     ^
/usr/include/c++/9/bits/stl_vector.h:471:20: error: no members matching 'std::vector<int, int>::_Base {aka std::_Vector_base<int, int>}::_M_allocate' in 'std::vector<int, int>::_Base' {aka 'struct std::_Vector_base<int, int>'}
  471 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:472:20: error: no members matching 'std::vector<int, int>::_Base {aka std::_Vector_base<int, int>}::_M_deallocate' in 'std::vector<int, int>::_Base' {aka 'struct std::_Vector_base<int, int>'}
  472 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:474:20: error: no members matching 'std::vector<int, int>::_Base {aka std::_Vector_base<int, int>}::_M_get_Tp_allocator' in 'std::vector<int, int>::_Base' {aka 'struct std::_Vector_base<int, int>'}
  474 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = int; _Alloc = int]':
/in/foo.cc:13:18:   recursively required from 'std::vector<_Tp, _Alloc>::vector() [with _Tp = int; _Alloc = int]'
/in/foo.cc:13:18:   required from here
/usr/include/c++/9/bits/stl_vector.h:128:2: error: 'int' is not a class, struct, or union type
  128 |  _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
      |  ^~~~~~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:16:27: error: no matching function for call to 'std::vector<int, int>::push_back(<brace-enclosed initializer list>)'
   16 |   points.push_back({x2,y2});
      |                           ^
In file included from /usr/include/c++/9/vector:67,
                 from /usr/include/c++/9/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
                 from /in/foo.cc:1:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = int; std::vector<_Tp, _Alloc>::value_type = int]'
 1184 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const int&'}
 1184 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = int; std::vector<_Tp, _Alloc>::value_type = int]'
 1200 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1200:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<int, int>::value_type&&' {aka 'int&&'}
 1200 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
/in/foo.cc:20:20: error: no matching function for call to 'begin(std::vector<int, int>&)'
   20 |  for(auto &point : points){
      |                    ^~~~~~
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 /in/foo.cc:1:
/usr/include/c++/9/initializer_list:89:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   89 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/9/initializer_list:89:5: note:   template argument deduction/substitution failed:
/in/foo.cc:20:20: note:   'std::vector<int, int>' is not derived from 'std::initializer_list<_Tp>'
   20 |  for(auto &point : points){
      |                    ^~~~~~
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 /in/foo.cc:1:
/usr/include/c++/9/bits/range_access.h:48:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note:   template argument deduction/substitution failed:
/usr/include/c++/9/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::vector<int, int>]':
/in/foo.cc:20:20:   required from here
/usr/include/c++/9/bits/range_access.h:48:50: error: 'class std::vector<int, int>' has no member named 'begin'
   48 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |                                           ~~~~~~~^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note: candidate: '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:58:5: note:   template argument deduction/substitution failed:
/usr/include/c++/9/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::vector<int, int>]':
/in/foo.cc:20:20:   required from here
/usr/include/c++/9/bits/range_access.h:58:56: error: 'const class std::vector<int, int>' has no member named 'begin'
   58 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |                                                 ~~~~~~~^~~~~
/usr/include/c++/9/bits/range_access.h:87:5: note: candidate: '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:87:5: note:   template argument deduction/substitution failed:
/in/foo.cc:20:20: note:   mismatched types '_Tp [_Nm]' and 'std::vector<int, int>'
   20 |  for(auto &point : points){
      |                    ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/9/valarray:1214:5: note: candidate: 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/9/valarray:1214:5: note:   template

信息

递交者
类型
自测
题目
P1049 最短距离的点
语言
C++
递交时间
2025-03-29 02:35:47
评测时间
2025-03-29 02:35:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes