Language: C++

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

int main() {
    
    int64_t N,W;
    cin >> N >> W;
    vector<int,int> A(N);
    for(int i=0; i<N i++){cin >> A[i].first>>A[i].second;}
    vector<vector<int64_t>> dp(N+1,vector<int64_t>(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<int, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<int, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:9:24:   required from here
    9 |     vector<int,int> A(N);
      |                        ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: '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: '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<int, int>':
a.cc:9:24:   required from here
    9 |     vector<int,int> A(N);
      |                        ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, 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<int, 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<int, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:24: error: call of overloaded 'vector(int64_t&)' is ambiguous
    9 |     vector<int,int> A(N);
      |                        ^
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = int]'
  620 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = int]'
  601 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = int; _Alloc = int; size_type = long unsigned int; allocator_type = int]'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = int; _Alloc = int; allocator_type = int]'
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
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<int, 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<int, int>' and 'int')
   10 |     for(int i=0; i<N i++){cin >> A[i].first>>A[i].second;}
      |                                               ^
a.cc:16:13: error: no match for 'operator[]' (operand types are 'std::vector<int, 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<int, 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() {
      |            ^