Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:10:15: error: no matching function for call to 'pow(int)'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
In file included from /usr/include/c++/12/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Constant, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   candidate expects 2 arguments, 1 provided
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_Constant, _Tp, _Tp>, _Tp> std::pow(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const valarray<_Tp>&, const valarray<_Tp>&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   candidate expects 2 arguments, 1 provided
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const valarray<typename _Dom::valarray>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   candidate expects 2 arguments, 1 provided
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename _Dom1::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
  549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/valarray_after.h:549:1: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
In file included from /usr/include/c++/12/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:54:
/usr/include/c++/12/complex:1870:5: note: candidate: 'template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const complex<_Tp>&, const complex<_Up>&)'
 1870 |     pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
      |     ^~~
/usr/include/c++/12/complex:1870:5: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::complex<_Tp>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/complex:1862:5: note: candidate: 'template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const _Tp&, const complex<_Up>&)'
 1862 |     pow(const _Tp& __x, const std::complex<_Up>& __y)
      |     ^~~
/usr/include/c++/12/complex:1862:5: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   candidate expects 2 arguments, 1 provided
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/complex:1854:5: note: candidate: 'template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const complex<_Tp>&, const _Up&)'
 1854 |     pow(const std::complex<_Tp>& __x, const _Up& __y)
      |     ^~~
/usr/include/c++/12/complex:1854:5: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::complex<_Tp>' and 'int'
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/complex:1073:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::pow(const _Tp&, const complex<_Tp>&)'
 1073 |     pow(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~
/usr/include/c++/12/complex:1073:5: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   candidate expects 2 arguments, 1 provided
   10 |         if(pow(a*3)+pow(b*3)+pow(c*3)==n)
      |            ~~~^~~~~
/usr/include/c++/12/complex:1062:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::pow(const complex<_Tp>&, const complex<_Tp>&)'
 1062 |     pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~
/usr/include/c++/12/complex:1062:5: note:   template argument deduction/substitution failed:
/in/foo.cc:10:15: note:   mismatched types 'const std::complex<_Tp>' and 'int'
   1

信息

递交者
类型
递交
题目
P1039 xf2-5水仙花数
语言
C++
递交时间
2025-02-03 09:55:45
评测时间
2025-02-03 09:55:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes