foo.cpp:1:1: error: 'include' does not name a type
include <iostream>
^
foo.cpp: In function 'int dfs(int, int)':
foo.cpp:8:133: error: 'max' was not declared in this scope
if(n<0) return -9999999; if(m*n==0) return 0; if(f[m][n]!=0) return f[m][n]; return f[m][n]=max(dfs(m-1,n),dfs(m-1,n-v[m])+v[m]*p[m]); } int main() { int n,m; cin>>n>>m;
^
foo.cpp: In function 'int main()':
foo.cpp:8:160: error: 'cin' was not declared in this scope
if(n<0) return -9999999; if(m*n==0) return 0; if(f[m][n]!=0) return f[m][n]; return f[m][n]=max(dfs(m-1,n),dfs(m-1,n-v[m])+v[m]*p[m]); } int main() { int n,m; cin>>n>>m;
^
foo.cpp:11:1: error: 'cout' was not declared in this scope
cout<<dfs(m,n);
^
foo.cpp: In function 'int dfs(int, int)':
foo.cpp:8:136: warning: control reaches end of non-void function [-Wreturn-type]
if(n<0) return -9999999; if(m*n==0) return 0; if(f[m][n]!=0) return f[m][n]; return f[m][n]=max(dfs(m-1,n),dfs(m-1,n-v[m])+v[m]*p[m]); } int main() { int n,m; cin>>n>>m;
^