Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:29:10: error: no match for 'operator=' (operand types are 'std::vector<std::vector<int> >' and 'int')
   29 |     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)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/in/foo.cc:33:23: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int')
   33 |             if (dp[j] == -1) continue;
In file included from /usr/include/c++/12/iosfwd:40,
                 from /usr/include/c++/12/ios:38,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/12/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::fpos<_StateT>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
In file included from /usr/include/c++/12/string:41,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42:
/usr/include/c++/12/bits/allocator.h:219:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
  219 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/12/bits/allocator.h:219:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::allocator<_CharT>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
In file included from /usr/include/c++/12/string:47:
/usr/include/c++/12/bits/stl_iterator.h:444:5: note: candidate: 'template<class _Iterator> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  444 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:444:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
/usr/include/c++/12/bits/stl_iterator.h:489:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  489 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:489:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
/usr/include/c++/12/bits/stl_iterator.h:1656:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1656 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1656:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
/usr/include/c++/12/bits/stl_iterator.h:1726:5: note: candidate: 'template<class _Iterator> bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1726 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1726:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
In file included from /usr/include/c++/12/bits/stl_algobase.h:64,
                 from /usr/include/c++/12/string:50:
/usr/include/c++/12/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::pair<_T1, _T2>'
   33 |             if (dp[j] == -1) continue;
      |                           ^
In file included from /usr/include/c++/12/string:53:
/usr/include/c++/12/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
/in/foo.cc:33:27: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const st

信息

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