Language: C++

clude <bits/stdc++.h>
using namespace std;
 
long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
{
    int n=w.size();
    vector<vector<long long>>dp(n+1,vector<long long>(W+1,0));
   
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=W;j++)
        {
            if(j-w[i-1]>=0)
                dp[i][j]=max(dp[i-1][j],v[i-1]+dp[i-1][j-w[i-1]]);
            else dp[i][j]=dp[i-1][j];
        }
    }
    
    return dp[n][W];
   
}
 
int main() {
	int n;
	long long int W;
	cin>>n>>W;
	vector<long long int>w(n);
	vector<long long int>v(n);
	for(int i=0;i<n;i++)cin>>w[i]>>v[i];
	
	cout<<knapsack1(w,v,W);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <bits/stdc++.h>
      | ^~~~~
a.cc:4:25: error: 'vector' was not declared in this scope
    4 | long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
      |                         ^~~~~~
a.cc:4:32: error: expected primary-expression before 'long'
    4 | long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
      |                                ^~~~
a.cc:4:48: error: 'vector' was not declared in this scope
    4 | long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
      |                                                ^~~~~~
a.cc:4:55: error: expected primary-expression before 'long'
    4 | long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
      |                                                       ^~~~
a.cc:4:72: error: expected primary-expression before 'long'
    4 | long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
      |                                                                        ^~~~
a.cc:4:87: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | long long int knapsack1(vector<long long int>w,vector<long long int >v,long long int W)
      |                                                                                       ^
a.cc: In function 'int main()':
a.cc:26:9: error: 'cin' was not declared in this scope
   26 |         cin>>n>>W;
      |         ^~~
a.cc:27:9: error: 'vector' was not declared in this scope
   27 |         vector<long long int>w(n);
      |         ^~~~~~
a.cc:27:16: error: expected primary-expression before 'long'
   27 |         vector<long long int>w(n);
      |                ^~~~
a.cc:28:16: error: expected primary-expression before 'long'
   28 |         vector<long long int>v(n);
      |                ^~~~
a.cc:29:34: error: 'w' was not declared in this scope
   29 |         for(int i=0;i<n;i++)cin>>w[i]>>v[i];
      |                                  ^
a.cc:29:40: error: 'v' was not declared in this scope
   29 |         for(int i=0;i<n;i++)cin>>w[i]>>v[i];
      |                                        ^
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout<<knapsack1(w,v,W);
      |         ^~~~
a.cc:31:25: error: 'w' was not declared in this scope
   31 |         cout<<knapsack1(w,v,W);
      |                         ^
a.cc:31:27: error: 'v' was not declared in this scope
   31 |         cout<<knapsack1(w,v,W);
      |                           ^
a.cc:31:24: error: 'knapsack1' cannot be used as a function
   31 |         cout<<knapsack1(w,v,W);
      |               ~~~~~~~~~^~~~~~~