/ WHOJ /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:30:14: error: reference to 'count' is ambiguous
   30 |   memory=pos;count++;
      |              ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algo.h:4113:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4113 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
foo.cc:4:11: note:                 'int count'
    4 | int pos=0,count=0,memory;
      |           ^~~~~
foo.cc:33:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |  while(pos<pas.size())
      |        ~~~^~~~~~~~~~~
foo.cc:40:4: error: reference to 'count' is ambiguous
   40 |    count++;
      |    ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algo.h:4113:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4113 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
foo.cc:4:11: note:                 'int count'
    4 | int pos=0,count=0,memory;
      |           ^~~~~
foo.cc:44:8: error: reference to 'count' is ambiguous
   44 |  cout<<count<<" "<<memory<<endl;
      |        ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algo.h:4113:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4113 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
foo.cc:4:11: note:                 'int count'
    4 | int pos=0,count=0,memory;
      |           ^~~~~
正在同步测试数据,请稍后
Found 10 testcases.
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1311 [NOIP2014 提高组] 生活大爆炸版石头剪刀布
题目数据
下载
语言
C++
递交时间
2022-07-16 17:15:51
评测时间
2022-07-16 17:15:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes