Borderou de evaluare (job #3354826)
| Utilizator | Data | 20 mai 2026 21:31:14 | |
|---|---|---|---|
| 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:25:20: error: expected ';' before 'max'
25 | dp[cap] max(dp[cap], dp[cap - w] + pret);
| ^ ~~~
| ;
main.cpp:25:19: warning: ignoring return value of 'constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
25 | dp[cap] max(dp[cap], dp[cap - w] + pret);
| ^
In file included from /usr/include/c++/12.2.1/vector:64,
from /usr/include/c++/12.2.1/functional:62,
from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:71,
from main.cpp:3:
/usr/include/c++/12.2.1/bits/stl_vector.h:1121:7: note: declared here
1121 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !
