/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:15:15: error: reference to 'count' is ambiguous
     for(i=100;count<m;i--)
               ^~~~~
foo.cc:4:15: note: candidates are: int count
 int n,m,ss,kk,count=0,i,max=0,x,j;
               ^~~~~
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:4076:5: note:                 template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)
     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
     ^~~~~
foo.cc:16:9: error: reference to 'count' is ambiguous
         count+=s[i];
         ^~~~~
foo.cc:4:15: note: candidates are: int count
 int n,m,ss,kk,count=0,i,max=0,x,j;
               ^~~~~
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:4076:5: note:                 template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)
     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
     ^~~~~
foo.cc:17:26: error: reference to 'count' is ambiguous
     printf("%d %d\n",i+1,count);//输出
                          ^~~~~
foo.cc:4:15: note: candidates are: int count
 int n,m,ss,kk,count=0,i,max=0,x,j;
               ^~~~~
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:4076:5: note:                 template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)
     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
     ^~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1813 分数线划定
语言
C++
递交时间
2021-10-29 20:18:46
评测时间
2021-10-29 20:18:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes