记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:21:23: error: no matching function for call to 'std::vector<int>::push_back(std::vector<int>&)'
   21 |   buc[0].push_back(tmp);
      |                       ^
In file included from /usr/include/c++/9/vector:67,
                 from foo.cc:4:
/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 = std::allocator<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 'std::vector<int>' 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 = std::allocator<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 'std::vector<int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1200 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
foo.cc:27:24: error: no matching function for call to 'std::vector<int>::push_back(std::vector<int>&)'
   27 |    buc[i].push_back(tmp);
      |                        ^
In file included from /usr/include/c++/9/vector:67,
                 from foo.cc:4:
/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 = std::allocator<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 'std::vector<int>' 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 = std::allocator<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 'std::vector<int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1200 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
foo.cc:24:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   24 |    scanf("%d",&a[i]);
      |    ~~~~~^~~~~~~~~~~~
foo.cc:32:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   32 |    scanf("%d%d",&l,&r);
      |    ~~~~~^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1316 Multiple of k
语言
C++
递交时间
2022-02-03 10:31:12
评测时间
2022-02-03 10:31:12
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes