Borderou de evaluare (job #3039434)

Utilizator caracioni_octavianCaracioni Octavian caracioni_octavian Data 28 martie 2023 16:08:09
Problema Oo Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'int solve(int, int)': main.cpp:17:5: error: 'memset' was not declared in this scope 17 | memset(dp, 0, sizeof(int) * (NMAX - 2)); | ^~~~~~ main.cpp:3:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'? 2 | #include <fstream> +++ |+#include <cstring> 3 | main.cpp: In function 'int main()': main.cpp:34:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)' 34 | fout << max({a[1] + a[2] + solve(4, N - 1), a[1] + a[N] + solve(3, N - 2), solve(2, N)}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:34:16: note: candidate expects 2 arguments, 1 provided 34 | fout << max({a[1] + a[2] + solve(4, N - 1), a[1] + a[N] + solve(3, N - 2), solve(2, N)}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /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:34:16: note: candidate expects 3 arguments, 1 provided 34 | fout << max({a[1] + a[2] + solve(4, N - 1), a[1] + a[N] + solve(3, N - 2), solve(2, N)}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Non zero exit status: 1

Ceva nu functioneaza?