Borderou de evaluare (job #3327533)

Utilizator mirceamaierean41Mircea Maierean mirceamaierean41 Data 4 decembrie 2025 13:13:36
Problema Hotel Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In constructor 'ST::ST()': main.cpp:13:34: warning: 'ST::maxSum' will be initialized after [-Wreorder] 13 | int lazy, leftSum, rightSum, maxSum; | ^~~~~~ main.cpp:13:9: warning: 'int ST::lazy' [-Wreorder] 13 | int lazy, leftSum, rightSum, maxSum; | ^~~~ main.cpp:14:5: warning: when initialized here [-Wreorder] 14 | ST() : leftSum{1}, rightSum{1}, maxSum{1}, lazy{-1} {}; | ^~ main.cpp: In function 'void merge(ST&, ST&, ST&, bool, bool)': main.cpp:37:22: error: no matching function for call to 'max(<brace-enclosed initializer list>)' 37 | node.maxSum = max({left.maxSum, right.maxSum, left.rightSum + right.leftSum}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/12.2.1/string:50, 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_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 254 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/12.2.1/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed: main.cpp:37:22: note: candidate expects 2 arguments, 1 provided 37 | node.maxSum = max({left.maxSum, right.maxSum, left.rightSum + right.leftSum}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/12.2.1/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed: main.cpp:37:22: note: candidate expects 3 arguments, 1 provided 37 | node.maxSum = max({left.maxSum, right.maxSum, left.rightSum + right.leftSum}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Non zero exit status: 1

Ceva nu functioneaza?