Borderou de evaluare (job #3283461)

Utilizator iulia_morariuIuli Morariu iulia_morariu Data 9 martie 2025 17:07:29
Problema Matrice 2 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:112:28: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int' 112 | add( x * n + y, (x + ox[j]) * n + (y + oy[j]) ); | ~~~~~~^~~ main.cpp:47:16: note: initializing argument 1 of 'void add(int&, int&)' 47 | void add(int & a, int & b){ | ~~~~~~^ main.cpp:121:69: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int' 121 | if(sol[qr[ii].idx] == 0 && in_acelasi_zet(qr[ii].x1 * n + qr[ii].y1, qr[ii].x2 * n + qr[ii].y2)) sol[ qr[ii].idx ] = v[x][y]; | ~~~~~~~~~~~~~~^~~~~~~~~~~ main.cpp:43:27: note: initializing argument 1 of 'bool in_acelasi_zet(int&, int&)' 43 | bool in_acelasi_zet(int & a, int & b){ | ~~~~~~^ In file included from /usr/include/c++/12.2.1/string:48, 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:2: /usr/include/c++/12.2.1/bits/stl_function.h: In instantiation of 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = query]': /usr/include/c++/12.2.1/bits/predefined_ops.h:158:30: required from 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = query*; _Iterator2 = query*; _Compare = std::greater<query>]' /usr/include/c++/12.2.1/bits/stl_algo.h:1809:14: required from 'constexpr void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = query*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<query> >]' /usr/include/c++/12.2.1/bits/stl_algo.h:1849:25: required from 'constexpr void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = query*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<query> >]' /usr/include/c++/12.2.1/bits/stl_algo.h:1940:31: required from 'constexpr void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = query*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<query> >]' /usr/include/c++/12.2.1/bits/stl_algo.h:4853:18: required from 'constexpr void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = query*; _Compare = greater<query>]' main.cpp:98:9: required from here /usr/include/c++/12.2.1/bits/stl_function.h:398:20: error: no match for 'operator>' (operand types are 'const query' and 'const query') 398 | { return __x > __y; } | ~~~~^~~~~ In file included from /usr/include/c++/12.2.1/bits/stl_algobase.h:67, from /usr/include/c++/12.2.1/algorithm:60, from main.cpp:1: /usr/include/c++/12.2.1/bits/stl_iterator.h:579:5: note: candidate: 'template<class _IteratorL, class _IteratorR> requires three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&)' (reversed) 579 | operator<=>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_iterator.h:579:5: note: template argument deduction/substitution failed: /usr/include/c++/12.2.1/bits/stl_function.h:398:20: note: 'const query' is not derived from 'const std::reverse_iterator<_IteratorL>' 398 | { return __x > __y; } | ~~~~^~~~~ /usr/include/c++/12.2.1/bits/stl_iterator.h:1668:5: note: candidate: 'template<class _IteratorL, class _IteratorR> requires three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR> std::operator<=>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' (reversed) 1668 | operator<=>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_iterator.h:1668:5: note: template argument deduction/substitution failed: /usr/include/c++/12.2.1/bits/stl_function.h:398:20: note: 'const query' is not derived from 'const std::move_iterator<_IteratorL>' 398 | { return __x > __y; } | ~~~~^~~~~ In file included from /usr/include/c++/12.2.1/bits/stl_algobase.h:64: /usr/include/c++/12.2.1/bits/stl_pair.h:647:5: note: candidate: 'template<class _T1, class _T2> constexpr std::common_comparison_category_t<decltype (std::__detail::__synth3way(declval<_T1&>(), declval<_T1&>())), decltype (std::__detail::__synth3way(declval<_T2&>(), declval<_T2&>()))> std::operator<=>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' (rewritten) 647 | operator<=>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) Non zero exit status: 1

Ceva nu functioneaza?