QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#335749#6632. Minimize MedianGuanYunchangCompile Error//C++234.0kb2024-02-23 21:42:522024-02-23 21:42:53

Details

answer.code: In function ‘int main()’:
answer.code:109:20: error: no matching function for call to ‘max(int&, long long int&)’
  109 |             mxx=max(mxx,it.second);
      |                 ~~~^~~~~~~~~~~~~~~
In file included 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_algobase.h:257:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:109:20: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long long int’)
  109 |             mxx=max(mxx,it.second);
      |                 ~~~^~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:109:20: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long long int’)
  109 |             mxx=max(mxx,it.second);
      |                 ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note:   template argument deduction/substitution failed:
answer.code:109:20: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
  109 |             mxx=max(mxx,it.second);
      |                 ~~~^~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note:   template argument deduction/substitution failed:
answer.code:109:20: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
  109 |             mxx=max(mxx,it.second);
      |                 ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/bits/stl_algobase.h:71:
/usr/include/c++/13/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Val_less_iter::operator()(_Value&, _Iterator) const [with _Value = const std::pair<int, int>; _Iterator = __gnu_cxx::__normal_iterator<std::pair<long long int, int>*, std::vector<std::pair<long long int, int> > >]’:
/usr/include/c++/13/bits/stl_algo.h:2035:14:   required from ‘constexpr _ForwardIterator std::__upper_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<long long int, int>*, vector<pair<long long int, int> > >; _Tp = pair<int, int>; _Compare = __gnu_cxx::__ops::_Val_less_iter]’
/usr/include/c++/13/bits/stl_algo.h:2070:32:   required from ‘constexpr _FIter std::upper_bound(_FIter, _FIter, const _Tp&) [with _FIter = __gnu_cxx::__normal_iterator<pair<long long int, int>*, vector<pair<long long int, int> > >; _Tp = pair<int, int>]’
answer.code:127:35:   required from here
/usr/include/c++/13/bits/predefined_ops.h:98:22: error: no match for ‘operator<’ (operand types are ‘const std::pair<int, int>’ and ‘std::pair<long long int, int>’)
   98 |       { return __val < *__it; }
      |                ~~~~~~^~~~~~~
In file included from /usr/include/c++/13/bits/stl_algobase.h:67:
/usr/include/c++/13/bits/stl_iterator.h:1189:5: note: candidate: ‘template<class _IteratorL, class _IteratorR, class _Container> constexpr std::__detail::__synth3way_t<_IteratorR, _IteratorL> __gnu_cxx::operator<=>(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)’ (reversed)
 1189 |     operator<=>(const __normal_iterator<_IteratorL, _Container>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1189:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/predefined_ops.h:98:22: note:   ‘std::pair<long long int, int>’ is not derived from ‘const __gnu_cxx::__normal_iterator<_IteratorL, _Container>’
   98 |       { return __val < *__it; }
      |                ~~~~~~^~~~~~~
In file included from /usr/include/c++/13/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:181:
/usr/include/c++/13/bits/regex.h:1288:5: note: candidate: ‘template<class _Bi_iter, class _Ch_traits, class _Alloc> auto std::__cxx11::operator<=>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)’ (reversed)
 1288 |     operator<=>(const sub_match<_Bi_iter>& __lhs,
    ...