Guest
Login
跳过导航链接

Compile Error:

  : In function 'int countWays(int, int)':
:7:10: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
    7 |     dp = 1;
      |          ^
In file included from D:/msys64/ucrt64/include/c++/13.2.0/vector:72,
                 from :2:
D:/msys64/ucrt64/include/c++/13.2.0/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
D:/msys64/ucrt64/include/c++/13.2.0/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from D:/msys64/ucrt64/include/c++/13.2.0/vector:66:
D:/msys64/ucrt64/include/c++/13.2.0/bits/stl_vector.h:763:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  763 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
D:/msys64/ucrt64/include/c++/13.2.0/bits/stl_vector.h:763:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  763 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
D:/msys64/ucrt64/include/c++/13.2.0/bits/stl_vector.h:785:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  785 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
D:/msys64/ucrt64/include/c++/13.2.0/bits/stl_vector.h:785:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  785 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

  

Zhe Jiang University Of Technology Online Programming Space Beta1.3
Designed & Developped By Jin Qiwei
Refactored By cb@zjut.edu.cn , QQ Group: 723311416  All Copyright Reserved 2006-
317