/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int dfs(long long int)':
foo.cc:25:24: error: no matching function for call to 'max(long long int&, int)'
   25 |         return f[a]=max(a,dfs(a/2)+dfs(a/3)+dfs(a/4));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/string:50,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/locale_classes.h:40,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/ios_base.h:41,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/ios:42,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/istream:38,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/sstream:38,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/complex:45,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/ccomplex:39,
                 from stdc++.h:54:
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/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)
      |     ^~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
foo.cc:25:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   25 |         return f[a]=max(a,dfs(a/2)+dfs(a/3)+dfs(a/4));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/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)
      |     ^~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
foo.cc:25:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   25 |         return f[a]=max(a,dfs(a/2)+dfs(a/3)+dfs(a/4));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/algorithm:61,
                 from stdc++.h:65:
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/stl_algo.h:5746:5: note: candidate: 'template<class _Tp> _Tp std::max(initializer_list<_Tp>)'
 5746 |     max(initializer_list<_Tp> __l)
      |     ^~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/stl_algo.h:5746:5: note:   template argument deduction/substitution failed:
foo.cc:25:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |         return f[a]=max(a,dfs(a/2)+dfs(a/3)+dfs(a/4));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/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)
      |     ^~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/stl_algo.h:5756:5: note:   template argument deduction/substitution failed:
foo.cc:25:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |         return f[a]=max(a,dfs(a/2)+dfs(a/3)+dfs(a/4));
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1599 货币
语言
C++
递交时间
2023-12-10 11:10:50
评测时间
2023-12-10 11:10:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes