QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#45005#4561. Catfish FarmHuangHanShengCompile Error//C++141.2kb2022-08-22 12:28:442022-08-22 12:28:47

详细

answer.code: In function ‘int64_t max_weights(int, int, std::vector<int>, std::vector<int>*, std::vector<int>*)’:
answer.code:36:45: error: no match for ‘operator=’ (operand types are ‘std::pair<std::pair<int, int>, int>’ and ‘std::pair<std::pair<int, std::vector<int> >, std::vector<int> >’)
   36 |                 c[i]=mp(mp(X[i], Y[i]), W[i]);
      |                                             ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_pair.h:418:9: note: candidate: ‘template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = std::pair<int, int>; _T2 = int]’
  418 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:418:9: note:   template argument deduction/substitution failed:
/usr/include/c++/11/bits/stl_pair.h: In substitution of ‘template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<std::pair<int, int>&, const _U1&>, std::is_assignable<int&, const _U2&> >::value, std::pair<std::pair<int, int>, int>&>::type std::pair<std::pair<int, int>, int>::operator=<_U1, _U2>(const std::pair<_T1, _T2>&) [with _U1 = std::pair<int, std::vector<int> >; _U2 = std::vector<int>]’:
answer.code:36:31:   required from here
/usr/include/c++/11/bits/stl_pair.h:418:9: error: no type named ‘type’ in ‘struct std::enable_if<false, std::pair<std::pair<int, int>, int>&>’
/usr/include/c++/11/bits/stl_pair.h:430:9: note: candidate: ‘template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = std::pair<int, int>; _T2 = int]’
  430 |         operator=(pair<_U1, _U2>&& __p)
      |         ^~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:430:9: note:   template argument deduction/substitution failed:
/usr/include/c++/11/bits/stl_pair.h: In substitution of ‘template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<std::pair<int, int>&, _U1&&>, std::is_assignable<int&, _U2&&> >::value, std::pair<std::pair<int, int>, int>&>::type std::pair<std::pair<int, int>, int>::operator=<_U1, _U2>(std::pair<_T1, _T2>&&) [with _U1 = std::pair<int, std::vector<int> >; _U2 = std::vector<int>]’:
answer.code:36:31:   required from here
/usr/include/c++/11/bits/stl_pair.h:430:9: error: no type named ‘type’ in ‘struct std::enable_if<false, std::pair<std::pair<int, int>, int>&>’
/usr/include/c++/11/bits/stl_pair.h:390:7: note: candidate: ‘std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type) [with _T1 = std::pair<int, int>; _T2 = int; typename std::conditional<std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type = const std::pair<std::pair<int, int>, int>&]’
  390 |       operator=(typename conditional<
      |       ^~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:393:55: note:   no known conversion for argument 1 from ‘std::pair<std::pair<int, std::vector<int> >, std::vector<int> >’ to ‘std::conditional<true, const std::pair<std::pair<int, int>, int>&, const std::__nonesuch&>::type’ {aka ‘const std::pair<std::pair<int, int>, int>&’}
  390 |       operator=(typename conditional<
      |                 ~~~~~~~~~~~~~~~~~~~~~                  
  391 |                 __and_<is_copy_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
  392 |                        is_copy_assignable<_T2>>::value,
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  393 |                 const pair&, const __nonesuch&>::type __p)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_pair.h:401:7: note: candidate: ‘std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&>::type) [with _T1 = std::pair<int, int>; _T2 = int; typename std::conditional<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<...