Borderou de evaluare (job #2759437)

Utilizator mihnea_buzoiuMihnea Buzoiu mihnea_buzoiu Data 17 iunie 2021 19:10:42
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:28:49: error: 'max' was not declared in this scope best[j] = max(best[j], best[j-w] + p); ^ main.cpp:28:49: note: suggested alternative: In file included from /usr/include/c++/6/bits/char_traits.h:39:0, from /usr/include/c++/6/ios:40, from /usr/include/c++/6/ostream:38, from /usr/include/c++/6/iostream:39, from main.cpp:9: /usr/include/c++/6/bits/stl_algobase.h:265:5: note: 'std::max' max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ main.cpp:17:37: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("rucsac.in", "r", stdin); ^ main.cpp:18:39: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("rucsac.out", "w", stdout); ^ main.cpp:21:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &n, &g); ^ main.cpp:25:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &w, &p); ^ Non zero exit status: 1

Ceva nu functioneaza?