Compile Error

/in/foo.cc: In function 'int dp(int, int)':
/in/foo.cc:8:5: error: 'i' was not declared in this scope
  if(i==n) return res=0;
     ^
/in/foo.cc:9:30: error: 'j' was not declared in this scope
  else if(q<w[i])  res=dp(i+1,j);
                              ^
/in/foo.cc:11:18: error: 'j' was not declared in this scope
   res=max(dp(i+1,j),dp(i,q-w[i])+v[i]);
                  ^
/in/foo.cc:13:12: error: 'i' was not declared in this scope
  return jj[i]=res;
            ^

信息

递交者
类型
递交
题目
【新手练习】01背包
语言
C++
递交时间
2018-04-18 16:45:20
评测时间
2018-04-18 16:45:20
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes