Language: C++

#include <bits/stdc++.h>
#define INF 1e8
using namespace std;

int main() {
    
    int64_t N,W;
    cin >> N >> W;
    vector<int64_t,int64_t> A(N);
    for(int i=0; i<N i++){cin >> A[i].first>>A[i].second;}
    vector<vector<int>> dp(N+1,vector<int>(W+1))
       for(int i=0;i<=N;i++){
      for(int j=0; j<=W;j++){ dp[i][j]=0;}}
    for(int i=0;i<N;i++){
      for(int j=0; j<=W;j++){
        if(A[i].second>j)dp[i+1][j]=0;
        else{dp[i+1][j]=max(dp[i][j],dp[i][j-A[i].second]);}}
    cout <<dp[N][W]<< endl;

}


Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<long int, long int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<long int, long int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:9:32:   required from here
    9 |     vector<int64_t,int64_t> A(N);
      |                                ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'long int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'long int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<long int, long int>':
a.cc:9:32:   required from here
    9 |     vector<int64_t,int64_t> A(N);
      |                                ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<long int, long int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<long int, long int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<long int, long int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:21: error: expected ';' before 'i'
   10 |     for(int i=0; i<N i++){cin >> A[i].first>>A[i].second;}
      |                     ^~
      |                     ;
a.cc:10:35: error: no match for 'operator[]' (operand types are 'std::vector<long int, long int>' and 'int')
   10 |     for(int i=0; i<N i++){cin >> A[i].first>>A[i].second;}
      |                                   ^
a.cc:10:47: error: no match for 'operator[]' (operand types are 'std::vector<long int, long int>' and 'int')
   10 |     for(int i=0; i<N i++){cin >> A[i].first>>A[i].second;}
      |                                               ^
a.cc:12:8: error: expected ',' or ';' before 'for'
   12 |        for(int i=0;i<=N;i++){
      |        ^~~
a.cc:12:20: error: 'i' was not declared in this scope
   12 |        for(int i=0;i<=N;i++){
      |                    ^
a.cc:16:13: error: no match for 'operator[]' (operand types are 'std::vector<long int, long int>' and 'int')
   16 |         if(A[i].second>j)dp[i+1][j]=0;
      |             ^
a.cc:17:47: error: no match for 'operator[]' (operand types are 'std::vector<long int, long int>' and 'int')
   17 |         else{dp[i+1][j]=max(dp[i][j],dp[i][j-A[i].second]);}}
      |                                               ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^