Language: C++

#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
 
const LL inf = 11234567890123;
LL N, W;
std::vector<LL>w, v;
std::vector<std::vector<LL>>memo;
 
LL dp(LL i, LL j)
{
	if (j == 0) return 0;
	if (i == -1) return inf;
	if (memo[i][j] != -1) return memo[i][j];
	LL res;
	if (j < v[i]) res = dp(i - 1, j);
	else res = std::min(dp(i - 1, j - v[i]) + w[i], dp(i - 1, j));
	return memo[i][j] = res;
}
 
int main()
{
	in >> N >> W;
	w.resize(N); v.resize(N);
	rep(i, N) in >> w[i] >> v[i];
 
	memo.resize(N);
	rep(i, memo.size()) memo[i].resize(112345, -1);
	LL ans = 0;
	for (LL j =112345-1 j>0; --j)
	{
		if (dp(N - 1, j) <= W){
        ans= j;
          break;
        }
	}
	out << ans << std::endl;
}


Compiler output:
a.cc:8:6: error: 'vector' in namespace 'std' does not name a template type
    8 | std::vector<LL>w, v;
      |      ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define in std::cin
a.cc:9:6: error: 'vector' in namespace 'std' does not name a template type
    9 | std::vector<std::vector<LL>>memo;
      |      ^~~~~~
a.cc:9:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    9 | std::vector<std::vector<LL>>memo;
      | ^~~
a.cc: In function 'LL dp(LL, LL)':
a.cc:15:13: error: 'memo' was not declared in this scope
   15 |         if (memo[i][j] != -1) return memo[i][j];
      |             ^~~~
a.cc:17:17: error: 'v' was not declared in this scope
   17 |         if (j < v[i]) res = dp(i - 1, j);
      |                 ^
a.cc:18:25: error: 'min' is not a member of 'std'
   18 |         else res = std::min(dp(i - 1, j - v[i]) + w[i], dp(i - 1, j));
      |                         ^~~
a.cc:18:51: error: 'w' was not declared in this scope
   18 |         else res = std::min(dp(i - 1, j - v[i]) + w[i], dp(i - 1, j));
      |                                                   ^
a.cc:19:16: error: 'memo' was not declared in this scope
   19 |         return memo[i][j] = res;
      |                ^~~~
a.cc: In function 'int main()':
a.cc:1:17: error: 'cin' is not a member of 'std'
    1 | #define in std::cin
      |                 ^~~
a.cc:24:9: note: in expansion of macro 'in'
   24 |         in >> N >> W;
      |         ^~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define in std::cin
a.cc:25:9: error: 'w' was not declared in this scope
   25 |         w.resize(N); v.resize(N);
      |         ^
a.cc:25:22: error: 'v' was not declared in this scope
   25 |         w.resize(N); v.resize(N);
      |                      ^
a.cc:1:17: error: 'cin' is not a member of 'std'
    1 | #define in std::cin
      |                 ^~~
a.cc:26:19: note: in expansion of macro 'in'
   26 |         rep(i, N) in >> w[i] >> v[i];
      |                   ^~
a.cc:1:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #define in std::cin
      |                 ^~~
a.cc:26:19: note: in expansion of macro 'in'
   26 |         rep(i, N) in >> w[i] >> v[i];
      |                   ^~
a.cc:28:9: error: 'memo' was not declared in this scope
   28 |         memo.resize(N);
      |         ^~~~
a.cc:31:28: error: expected ';' before 'j'
   31 |         for (LL j =112345-1 j>0; --j)
      |                            ^~
      |                            ;
a.cc:2:18: error: 'cout' is not a member of 'std'
    2 | #define out std::cout
      |                  ^~~~
a.cc:38:9: note: in expansion of macro 'out'
   38 |         out << ans << std::endl;
      |         ^~~
a.cc:2:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #define out std::cout
      |                  ^~~~
a.cc:38:9: note: in expansion of macro 'out'
   38 |         out << ans << std::endl;
      |         ^~~
a.cc:38:28: error: 'endl' is not a member of 'std'
   38 |         out << ans << std::endl;
      |                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define in std::cin