记录详情

Compile Error

foo.cc: In function 'void performActivity(int, int)':
foo.cc:26:22: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   26 |         if (std::find(primes.begin(), primes.end(), i) != primes.end()) {
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/locale_facets.h:48,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/basic_ios.h:37,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/ios:44,
                 from /nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/ostream:38,
                 from iostream:39:
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/streambuf_iterator.h:434:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  434 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/nix/store/jgdz5wfqc6q6qhy17lsqnfpbkfi1fcar-gcc-12.2.0/include/c++/12.2.0/bits/streambuf_iterator.h:434:5: note:   template argument deduction/substitution failed:
foo.cc:26:22: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   26 |         if (std::find(primes.begin(), primes.end(), i) != primes.end()) {
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1010 s-0-1班级活动之选人
语言
C++
递交时间
2023-12-11 22:50:41
评测时间
2023-12-11 22:50:41
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes