Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:22:10: error: no match for 'operator=' (operand types are 'std::vector<std::vector<int> >' and 'int')
   22 |     dp = 0;
      |          ^
In file included from /usr/include/c++/12/vector:70,
                 from /in/foo.cc:2:
/usr/include/c++/12/bits/vector.tcc:204:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
  204 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/vector.tcc:205:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<int> >&'
  205 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/12/vector:64:
/usr/include/c++/12/bits/stl_vector.h:761:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
  761 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/12/bits/stl_vector.h:761:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >&&'
  761 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/12/bits/stl_vector.h:783:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
  783 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/12/bits/stl_vector.h:783:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<int> >'
  783 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

信息

递交者
类型
递交
题目
P1019 分配时间(times)
语言
C++
递交时间
2026-08-10 09:18:41
评测时间
2026-08-10 09:18:41
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes