Problem coinbag
User RendezvousAnonymous
Submission Time 2023-11-16 23:15:58
Score 0
Max Time N/A
Max Memory N/A

Compile Error

coinbag.cpp: In function ‘int main()’:
coinbag.cpp:6:5: error: ‘cin’ was not declared in this scope
6 | cin >> n >> c;
| ^~~
coinbag.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
+++ |+#include <iostream>
1 | using namespace std;
coinbag.cpp:12:5: error: ‘memset’ was not declared in this scope
12 | memset(bestval, 0, sizeof(bestval));
| ^~~~~~
coinbag.cpp:1:1: note: ‘memset’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
+++ |+#include <cstring>
1 | using namespace std;
coinbag.cpp:24:35: error: ‘max’ was not declared in this scope
24 | bestval[i][cap] = max(bestval[i][cap], bestval[i - 1][cap - w[i]] + v[i]);
| ^~~
coinbag.cpp:28:35: error: ‘max’ was not declared in this scope
28 | b