记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:11:25: error: reference to ‘max’ is ambiguous
   11 |                 if(a[i]>max)
      |                         ^~~
In file included from /nix/gcc-13.3.0/include/c++/13.3.0/algorithm:61,
                 from stdc++.h:51:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5805:5: note: candidates are: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5795:5: note:                 ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
In file included from /nix/gcc-13.3.0/include/c++/13.3.0/algorithm:60:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note:                 ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
foo.cc:3:7: note:                 ‘int max’
    3 | int n,max,t,x,a[10005];
      |       ^~~
foo.cc:13:25: error: reference to ‘max’ is ambiguous
   13 |                         max=a[i];
      |                         ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5805:5: note: candidates are: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5795:5: note:                 ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note:                 ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
foo.cc:3:7: note:                 ‘int max’
    3 | int n,max,t,x,a[10005];
      |       ^~~
foo.cc:18:14: error: reference to ‘max’ is ambiguous
   18 |         a[1]=max;
      |              ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5805:5: note: candidates are: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algo.h:5795:5: note:                 ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note:                 ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
foo.cc:3:7: note:                 ‘int max’
    3 | int n,max,t,x,a[10005];
      |       ^~~
正在同步测试数据,请稍后

信息

递交者
类型
递交
题目
旗手
语言
C++
递交时间
2024-07-14 10:46:46
评测时间
2024-07-14 10:46:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes