记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:33:38: error: no matching function for call to 'min(int, LL&)'
   33 |                                 b=min(1+x[i++],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:33:38: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'LL' {aka 'long long int'})
   33 |                                 b=min(1+x[i++],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:33:38: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'LL' {aka 'long long int'})
   33 |                                 b=min(1+x[i++],a);
      |                                   ~~~^~~~~~~~~~~~
In file included from /nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/algorithm:61,
                 from foo.cc:2:
/nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/bits/stl_algo.h:5726:5: note: candidate: 'template<class _Tp> _Tp std::min(initializer_list<_Tp>)'
 5726 |     min(initializer_list<_Tp> __l)
      |     ^~~
/nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/bits/stl_algo.h:5726:5: note:   template argument deduction/substitution failed:
foo.cc:33:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   33 |                                 b=min(1+x[i++],a);
      |                                   ~~~^~~~~~~~~~~~
/nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/bits/stl_algo.h:5736:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(initializer_list<_Tp>, _Compare)'
 5736 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/bits/stl_algo.h:5736:5: note:   template argument deduction/substitution failed:
foo.cc:33:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   33 |                                 b=min(1+x[i++],a);
      |                                   ~~~^~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1504 Problem 2A.拆弹专家
语言
C++
递交时间
2023-10-16 21:20:37
评测时间
2023-10-16 21:20:37
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes