Borderou de evaluare (job #3201935)
Utilizator | Broscoi Mihai fortyfor | Data | 10 februarie 2024 10:02:48 |
---|---|---|---|
Problema | Elementul majoritar | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:25:5: error: 'k' was not declared in this scope
25 | k=std::count(numbers.begin(),m,numbers.end());
| ^
main.cpp:25:17: error: no matching function for call to 'count(std::vector<int>::iterator, int&, std::vector<int>::iterator)'
25 | k=std::count(numbers.begin(),m,numbers.end());
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/algorithm:61,
from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:65,
from main.cpp:1:
/usr/include/c++/12.2.1/bits/stl_algo.h:4026:5: note: candidate: 'template<class _IIter, class _Tp> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4026 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
/usr/include/c++/12.2.1/bits/stl_algo.h:4026:5: note: template argument deduction/substitution failed:
main.cpp:25:17: note: deduced conflicting types for parameter '_IIter' ('__gnu_cxx::__normal_iterator<int*, std::vector<int> >' and 'int')
25 | k=std::count(numbers.begin(),m,numbers.end());
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/algorithm:73:
/usr/include/c++/12.2.1/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/12.2.1/pstl/glue_algorithm_defs.h:101:1: note: template argument deduction/substitution failed:
main.cpp:25:17: note: deduced conflicting types for parameter '_ForwardIterator' ('int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
25 | k=std::count(numbers.begin(),m,numbers.end());
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !