记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:17:35: error: no matching function for call to 'min(int&, long long int&)'
   17 |                         sum += min(c, a);
      |                                ~~~^~~~~~
In file included from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/string:50,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/locale_classes.h:40,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:41,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/ios:42,
                 from /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/ostream:38,
                 from iostream:39:
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
foo.cc:17:35: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   17 |                         sum += min(c, a);
      |                                ~~~^~~~~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
foo.cc:17:35: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   17 |                         sum += min(c, a);
      |                                ~~~^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1504 Problem 2A.拆弹专家
比赛
2023秋 悬赏令第二周
语言
C++
递交时间
2023-10-17 19:17:39
评测时间
2023-10-17 19:17:39
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes