Language: C++

V#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define F first
#define S second
#define ld long double
#define rep(i,a,n) for (ll i= (a) ; i < (n); ++i)
#define vi vector<ll>
#define all(v) (v).begin(),(v).end()
#define M_PI 3.14159265358979323846
const ll MOD = 1e9 + 7;

void solve() {
	ll n, W; cin >> n >> W;
	vi dp(W + 1);
	vi value(n), weight(n);

	rep(i, 0, n) {
		ll weight, value;
		cin >> weight >> value;

		for (ll w = W - weight; w >= 0; w--) {
			dp[w + weight] = max(dp[w + weight], dp[w] + value);
		}
	}

	cout << *max_element(all(dp)) << endl;
}


int main() {

	int t = 1;

	//cin >> t;
	ll k = 1;
	while (t--) {
		//cout << "Case #" << k++ << ": ";
		solve();
	}
	return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | V#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'V' does not name a type
    1 | V#include<bits/stdc++.h>
      | ^
a.cc: In function 'void solve()':
a.cc:18:18: error: 'cin' was not declared in this scope
   18 |         ll n, W; cin >> n >> W;
      |                  ^~~
a.cc:12:12: error: 'vector' was not declared in this scope
   12 | #define vi vector<ll>
      |            ^~~~~~
a.cc:19:9: note: in expansion of macro 'vi'
   19 |         vi dp(W + 1);
      |         ^~
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:12:19: note: in expansion of macro 'll'
   12 | #define vi vector<ll>
      |                   ^~
a.cc:19:9: note: in expansion of macro 'vi'
   19 |         vi dp(W + 1);
      |         ^~
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:12:19: note: in expansion of macro 'll'
   12 | #define vi vector<ll>
      |                   ^~
a.cc:20:9: note: in expansion of macro 'vi'
   20 |         vi value(n), weight(n);
      |         ^~
a.cc:27:25: error: 'dp' was not declared in this scope; did you mean 'mp'?
   27 |                         dp[w + weight] = max(dp[w + weight], dp[w] + value);
      |                         ^~
      |                         mp
a.cc:27:42: error: 'max' was not declared in this scope
   27 |                         dp[w + weight] = max(dp[w + weight], dp[w] + value);
      |                                          ^~~
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout << *max_element(all(dp)) << endl;
      |         ^~~~
a.cc:31:34: error: 'dp' was not declared in this scope; did you mean 'mp'?
   31 |         cout << *max_element(all(dp)) << endl;
      |                                  ^~
a.cc:13:17: note: in definition of macro 'all'
   13 | #define all(v) (v).begin(),(v).end()
      |                 ^
a.cc:31:18: error: 'max_element' was not declared in this scope
   31 |         cout << *max_element(all(dp)) << endl;
      |                  ^~~~~~~~~~~
a.cc:31:42: error: 'endl' was not declared in this scope
   31 |         cout << *max_element(all(dp)) << endl;
      |                                          ^~~~