/ Vijos /

记录详情

Compile Error

foo.cc: In function 'bool check(long double)':
foo.cc:23:18: error: no matching function for call to 'max(long double&, int&)'
   t=max(t,nn[i].s);
                  ^
In file included from /usr/include/c++/7/algorithm:61:0,
                 from foo.cc:4:
/usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/7/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
foo.cc:23:18: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'int')
   t=max(t,nn[i].s);
                  ^
In file included from /usr/include/c++/7/algorithm:61:0,
                 from foo.cc:4:
/usr/include/c++/7/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++/7/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
foo.cc:23:18: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'int')
   t=max(t,nn[i].s);
                  ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from foo.cc:4:
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
/usr/include/c++/7/bits/stl_algo.h:3462:5: note:   template argument deduction/substitution failed:
foo.cc:23:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   t=max(t,nn[i].s);
                  ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from foo.cc:4:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/7/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
foo.cc:23:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   t=max(t,nn[i].s);
                  ^
foo.cc: In function 'int main()':
foo.cc:29:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
foo.cc:32:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d",&nn[i].s,&nn[i].e,&nn[i].dis);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
递交
题目
P1450 包裹快递
语言
C++
递交时间
2021-03-15 23:26:26
评测时间
2021-03-15 23:26:26
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes