Borderou de evaluare (job #3355056)
| Utilizator | Data | 21 mai 2026 17:40:37 | |
|---|---|---|---|
| Problema | Problema rucsacului | 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:23:70: error: no match for 'operator+' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'})
23 | if (sol[i] + rucsac[k].second > sol[i+rucsac[k]].first) {
In file included from /usr/include/c++/12.2.1/string:47,
from /usr/include/c++/12.2.1/bits/locale_classes.h:40,
from /usr/include/c++/12.2.1/bits/ios_base.h:41,
from /usr/include/c++/12.2.1/ios:42,
from /usr/include/c++/12.2.1/ostream:38,
from /usr/include/c++/12.2.1/iostream:39,
from main.cpp:1:
/usr/include/c++/12.2.1/bits/stl_iterator.h:630:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_IteratorL> std::operator+(typename reverse_iterator<_IteratorL>::difference_type, const reverse_iterator<_IteratorL>&)'
630 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_iterator.h:630:5: note: template argument deduction/substitution failed:
main.cpp:23:79: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_IteratorL>'
23 | if (sol[i] + rucsac[k].second > sol[i+rucsac[k]].first) {
| ^
/usr/include/c++/12.2.1/bits/stl_iterator.h:1786:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1786 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/stl_iterator.h:1786:5: note: template argument deduction/substitution failed:
main.cpp:23:79: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>'
23 | if (sol[i] + rucsac[k].second > sol[i+rucsac[k]].first) {
| ^
In file included from /usr/include/c++/12.2.1/string:53:
/usr/include/c++/12.2.1/bits/basic_string.h:3432:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3432 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:3432:5: note: template argument deduction/substitution failed:
main.cpp:23:79: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
23 | if (sol[i] + rucsac[k].second > sol[i+rucsac[k]].first) {
| ^
In file included from /usr/include/c++/12.2.1/string:54:
/usr/include/c++/12.2.1/bits/basic_string.tcc:606:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
606 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.tcc:606:5: note: template argument deduction/substitution failed:
main.cpp:23:79: note: mismatched types 'const _CharT*' and 'int'
23 | if (sol[i] + rucsac[k].second > sol[i+rucsac[k]].first) {
| ^
/usr/include/c++/12.2.1/bits/basic_string.tcc:627:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
627 | operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.tcc:627:5: note: template argument deduction/substitution failed:
main.cpp:23:79: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
23 | if (sol[i] + rucsac[k].second > sol[i+rucsac[k]].first) {
| ^
/usr/include/c++/12.2.1/bits/basic_string.h:3472:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3472 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !
