下列代码是一维数组优化 0/1 背包的核心片段,执行后 dp[8] 的输出结果是( )。

#include <iostream>#include <algorithm>using namespace std;int main() {   int w = 3, v = 5, W = 8;   int dp[9] = {0};   for (int c = W; c >= w; c--)      dp[c] = max(dp[c], dp[c - w] + v);   cout << dp[8] << endl;   return 0;}
填写答案