QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#524776#9178. All-You-Can-Eatucup-team3612Compile Error//C++231.7kb2024-08-20 05:48:032024-08-20 05:48:03

Details

answer.code: In function ‘int main()’:
answer.code:72:49: error: no match for ‘operator=’ (operand types are ‘ii’ {aka ‘std::pair<int, int>’} and ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’)
   72 |                         if(it!=s.begin()) now=--it;
      |                                                 ^~
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_pair.h:439:9: note: candidate: ‘template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) requires  _S_assignable<const _U1&, const _U2&>() [with _U2 = _U1; _T1 = int; _T2 = int]’
  439 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:439:9: note:   template argument deduction/substitution failed:
answer.code:72:49: note:   ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’ is not derived from ‘const std::pair<_T1, _T2>’
   72 |                         if(it!=s.begin()) now=--it;
      |                                                 ^~
/usr/include/c++/13/bits/stl_pair.h:451:9: note: candidate: ‘template<class _U1, class _U2> constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) requires  _S_assignable<_U1, _U2>() [with _U2 = _U1; _T1 = int; _T2 = int]’
  451 |         operator=(pair<_U1, _U2>&& __p)
      |         ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:451:9: note:   template argument deduction/substitution failed:
answer.code:72:49: note:   ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’ is not derived from ‘std::pair<_T1, _T2>’
   72 |                         if(it!=s.begin()) now=--it;
      |                                                 ^~
/usr/include/c++/13/bits/stl_pair.h:486:9: note: candidate: ‘template<class _U1, class _U2> constexpr const std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) const requires (is_assignable_v<const first_type&, const _U1&>) && (is_assignable_v<const second_type&, const _U2&>) [with _U2 = _U1; _T1 = int; _T2 = int]’
  486 |         operator=(const pair<_U1, _U2>& __p) const
      |         ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:486:9: note:   template argument deduction/substitution failed:
answer.code:72:49: note:   ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’ is not derived from ‘const std::pair<_T1, _T2>’
   72 |                         if(it!=s.begin()) now=--it;
      |                                                 ^~
/usr/include/c++/13/bits/stl_pair.h:498:9: note: candidate: ‘template<class _U1, class _U2> constexpr const std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) const requires (is_assignable_v<const first_type&, _U1>) && (is_assignable_v<const second_type&, _U2>) [with _U2 = _U1; _T1 = int; _T2 = int]’
  498 |         operator=(pair<_U1, _U2>&& __p) const
      |         ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:498:9: note:   template argument deduction/substitution failed:
answer.code:72:49: note:   ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’ is not derived from ‘std::pair<_T1, _T2>’
   72 |                         if(it!=s.begin()) now=--it;
      |                                                 ^~
/usr/include/c++/13/bits/stl_pair.h:416:7: note: candidate: ‘constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) requires  _S_assignable<const _T1&, const _T2&>() [with _T1 = int; _T2 = int]’
  416 |       operator=(const pair& __p)
      |       ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:416:29: note:   no known conversion for argument 1 from ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’ to ‘const std::pair<int, int>&’
  416 |       operator=(const pair& __p)
      |                 ~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_pair.h:427:7: note: candidate: ‘constexpr std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) requires  _S_assignable<_T1, _T2>() [with _T1 = int; _T2 = int]’
  427 |       operator=(pair&& __p)
      |       ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:427:24: note:   no known conversion for argument 1 from ‘std::_Rb_tree_const_iterator<std::pair<int, int> >::_Self’ to ‘std::pair<int, int>&&’
  427 |       operator=(pair&& __p)
      |                 ~~~~~~~^~~
/usr/include/c++/13/bits/stl_pair.h:463:7: note: candidate: ‘constexpr const std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) const requires (is_copy_assignable_v<const first_type>) && (is_copy_assignable_v<const second_type>) [with _T1 = int; _T2 = int]’
  463 |       operator=(const pair& __p) const
      |       ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:463:7: note: constraints not satisfied
/usr/include/...