记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:13:35: error: no matching function for call to 'ceil(int&, int&)'
  int ans=static_cast<int>(ceil(x,m));
                                   ^
In file included from /usr/include/features.h:364:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:507,
                 from /usr/include/c++/6/iostream:38,
                 from /in/foo.cc:7:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:178:1: note: candidate: double ceil(double)
 __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:178:1: note:   candidate expects 1 argument, 2 provided
In file included from /in/foo.cc:8:0:
/usr/include/c++/6/cmath:200:5: note: candidate: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::ceil(_Tp)
     ceil(_Tp __x)
     ^~~~
/usr/include/c++/6/cmath:200:5: note:   template argument deduction/substitution failed:
/in/foo.cc:13:35: note:   candidate expects 1 argument, 2 provided
  int ans=static_cast<int>(ceil(x,m));
                                   ^
In file included from /in/foo.cc:8:0:
/usr/include/c++/6/cmath:192:3: note: candidate: constexpr long double std::ceil(long double)
   ceil(long double __x)
   ^~~~
/usr/include/c++/6/cmath:192:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/6/cmath:188:3: note: candidate: constexpr float std::ceil(float)
   ceil(float __x)
   ^~~~
/usr/include/c++/6/cmath:188:3: note:   candidate expects 1 argument, 2 provided

信息

递交者
类型
递交
题目
P1035 课后服务教室分配
语言
C++
递交时间
2024-05-20 16:04:51
评测时间
2024-05-21 16:15:05
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes