/ Vijos /

记录详情

Compile Error

foo.cc: In function 'void yao(int, int, int*, int)':
foo.cc:9:33: error: no matching function for call to 'min(long long int&, int&)'
    9 |                 if(b==n) ans=min(ans,num);
      |                              ~~~^~~~~~~~~
In file included from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/string:50,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/locale_classes.h:40,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:41,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ios:42,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:38,
                 from iostream:39:
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-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/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
foo.cc:9:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |                 if(b==n) ans=min(ans,num);
      |                              ~~~^~~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-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/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
foo.cc:9:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |                 if(b==n) ans=min(ans,num);
      |                              ~~~^~~~~~~~~
foo.cc:37:25: error: no matching function for call to 'min(long long int&, int&)'
   37 |         if(b>=n) ans=min(ans,num);
      |                      ~~~^~~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-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/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
foo.cc:37:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   37 |         if(b>=n) ans=min(ans,num);
      |                      ~~~^~~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-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/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
foo.cc:37:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   37 |         if(b>=n) ans=min(ans,num);
      |                      ~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1026 毒药?解药?
语言
C++
递交时间
2023-12-19 23:27:36
评测时间
2023-12-19 23:27:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes