Borderou de evaluare (job #3194241)
Utilizator | Data | 17 ianuarie 2024 13:27:50 | |
---|---|---|---|
Problema | Senat | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:71:31: error: no matching function for call to 'count_if(int&, int&, main()::<lambda(int)>)'
71 | int raspuns = count_if(r[0], r[m+1], [](int x) { return x > 0;});
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/algorithm:61,
from main.cpp:8:
/usr/include/c++/12.2.1/bits/stl_algo.h:4050:5: note: candidate: 'template<class _IIter, class _Predicate> constexpr typename std::iterator_traits<_Iterator>::difference_type std::count_if(_IIter, _IIter, _Predicate)'
4050 | count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_algo.h:4050:5: note: template argument deduction/substitution failed:
/usr/include/c++/12.2.1/bits/stl_algo.h: In substitution of 'template<class _IIter, class _Predicate> constexpr typename std::iterator_traits<_Iterator>::difference_type std::count_if(_IIter, _IIter, _Predicate) [with _IIter = int; _Predicate = main()::<lambda(int)>]':
main.cpp:71:24: required from here
/usr/include/c++/12.2.1/bits/stl_algo.h:4050:5: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
In file included from /usr/include/c++/12.2.1/algorithm:73:
/usr/include/c++/12.2.1/pstl/glue_algorithm_defs.h:106:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
106 | count_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
| ^~~~~~~~
/usr/include/c++/12.2.1/pstl/glue_algorithm_defs.h:106:1: note: template argument deduction/substitution failed:
main.cpp:71:31: note: deduced conflicting types for parameter '_ForwardIterator' ('int' and 'main()::<lambda(int)>')
71 | int raspuns = count_if(r[0], r[m+1], [](int x) { return x > 0;});
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !