Borderou de evaluare (job #3244193)
Utilizator | Data | 24 septembrie 2024 01:07:27 | |
---|---|---|---|
Problema | Problema rucsacului | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:15:6: error: 'array' in namespace 'std' does not name a template type
15 | std::array<int, NMAX> w;
| ^~~~~
main.cpp:9:1: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
8 | #include <climits>
+++ |+#include <array>
9 |
main.cpp:16:6: error: 'array' in namespace 'std' does not name a template type
16 | std::array<int, NMAX> p;
| ^~~~~
main.cpp:16:1: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
16 | std::array<int, NMAX> p;
| ^~~
main.cpp:17:6: error: 'array' in namespace 'std' does not name a template type
17 | std::array<std::array<int, NMAX>, WMAX> dp;
| ^~~~~
main.cpp:17:1: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
17 | std::array<std::array<int, NMAX>, WMAX> dp;
| ^~~
main.cpp: In function 'void solve()':
main.cpp:25:16: error: 'w' was not declared in this scope
25 | cin >> w[i] >> p[i];
| ^
main.cpp:25:24: error: 'p' was not declared in this scope
25 | cin >> w[i] >> p[i];
| ^
main.cpp:30:13: error: 'dp' was not declared in this scope
30 | dp[i][used_weight] = dp[i-1][used_weight]; // case 1: don't take obj. 'i'
| ^~
main.cpp:31:31: error: 'w' was not declared in this scope
31 | if (used_weight - w[i] >= 0) { // case 2: take obj 'i', if there's enough "room"(weight) for it left
| ^
main.cpp:32:92: error: 'p' was not declared in this scope
32 | dp[i][used_weight] = max(dp[i][used_weight], dp[i - 1][used_weight-w[i]] + p[i]);
| ^
main.cpp:38:24: error: 'dp' was not declared in this scope
38 | ans = max(ans, dp[n][used_weight]);
| ^~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !