/ OPS /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:25:47: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   25 |     long long ans = max({0LL, dp_odd, dp_even});
      |                                               ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/9/bits/stl_algobase.h:222:5: note: candidate: 'template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)'
  222 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:222:5: note:   template argument deduction/substitution failed:
/in/foo.cc:25:47: note:   candidate expects 2 arguments, 1 provided
   25 |     long long ans = max({0LL, dp_odd, dp_even});
      |                                               ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/9/bits/stl_algobase.h:268:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  268 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:268:5: note:   template argument deduction/substitution failed:
/in/foo.cc:25:47: note:   candidate expects 3 arguments, 1 provided
   25 |     long long ans = max({0LL, dp_odd, dp_even});
      |                                               ^

信息

递交者
类型
递交
题目
P1007 Jumping Cows
语言
C++
递交时间
2025-01-21 14:18:15
评测时间
2025-01-21 14:18:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes