/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:49:19: error: no matching function for call to 'max(long long int&, int&)'
   49 |         result=max(result,it->m_score);
      |                ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/string:50,
                 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,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/12/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
/in/foo.cc:49:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   49 |         result=max(result,it->m_score);
      |                ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/12/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
/in/foo.cc:49:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   49 |         result=max(result,it->m_score);
      |                ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/algorithm:61,
                 from /in/foo.cc:4:
/usr/include/c++/12/bits/stl_algo.h:5746:5: note: candidate: 'template<class _Tp> _Tp std::max(initializer_list<_Tp>)'
 5746 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/12/bits/stl_algo.h:5746:5: note:   template argument deduction/substitution failed:
/in/foo.cc:49:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   49 |         result=max(result,it->m_score);
      |                ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algo.h:5756:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)'
 5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/12/bits/stl_algo.h:5756:5: note:   template argument deduction/substitution failed:
/in/foo.cc:49:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   49 |         result=max(result,it->m_score);
      |                ~~~^~~~~~~~~~~~~~~~~~~~

信息

递交者
类型
递交
题目
P1779 国王游戏
语言
C++
递交时间
2025-03-29 10:38:43
评测时间
2025-03-29 10:38:43
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes