/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:31:38: error: no matching function for call to 'max(int&, <unresolved overloaded function type>)'
  for(int j=0;j<=m;++j)mx=max(f[j],max);
                                      ^
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: candidate: const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const int&'
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
/in/foo.cc:31:38: note:   candidate expects 3 arguments, 2 provided
  for(int j=0;j<=m;++j)mx=max(f[j],max);
                                      ^
/in/foo.cc:6:11: warning: unused variable 'j' [-Wunused-variable]
     int i,j;
           ^

信息

递交者
类型
递交
题目
P1313 金明的预算方案
语言
C++
递交时间
2017-07-06 00:31:28
评测时间
2017-07-06 00:31:28
评测机
分数
0
总耗时
232ms
峰值内存
27.641 MiB