/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:17:12: error: reference to 'max' is ambiguous
         if(max<c[i])max=c[i];//max为c数组中的最大值
            ^~~
/in/foo.cc:5:27: note: candidates are: int max
 int n,b[300001],c[300001],max=0,ans=0;
                           ^~~
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_algo.h:3465:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
In file included from /usr/include/c++/6/algorithm:61:0,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:                 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:219:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/in/foo.cc:17:21: error: reference to 'max' is ambiguous
         if(max<c[i])max=c[i];//max为c数组中的最大值
                     ^~~
/in/foo.cc:5:27: note: candidates are: int max
 int n,b[300001],c[300001],max=0,ans=0;
                           ^~~
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_algo.h:3465:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
In file included from /usr/include/c++/6/algorithm:61:0,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:                 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:219:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/in/foo.cc:19:20: error: reference to 'max' is ambiguous
         if(b[i]+n>=max)//与c数组中的最大值max比较
                    ^~~
/in/foo.cc:5:27: note: candidates are: int max
 int n,b[300001],c[300001],max=0,ans=0;
                           ^~~
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/stl_algo.h:3465:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~

信息

递交者
类型
递交
题目
P1988 自行车比赛
语言
C++
递交时间
2017-04-14 20:05:26
评测时间
2017-04-14 20:05:26
评测机
分数
0
总耗时
201ms
峰值内存
24.875 MiB