Language: C++

#include<iostream>
#include<algorithm>
#define int long long
#include<bits/stdc++.h>
using namespace std;

int dp[5001];
signed main() {
	int n, w; cin >> n >> w;
	memset(dp, 0x3f, sizeof(dp));
	dp[0] = 0;
	for (int i = 0; i < n; i++) {
		int x, y; cin >> x >> y;
		for (int j = 5000; j >= y; j--) {
			dp[j] = min(dp[j], dp[j - y] + x);
		}
	}
	for (int i = 5000; i >= 0; i--) {
		if (dp[i] <= w) { cout << i << endl; return 0; }
	}
}

Compiler output:
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:3:13: error: expected '}' before 'long'
In file included from /usr/include/c++/14/vector:67,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_bvector.h:73:8: note: to match this '{'
   73 |   enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
      |        ^
/usr/include/c++/14/bits/stl_bvector.h:73:28: error: expected unqualified-id before numeric constant
   73 |   enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
      |                            ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:73:28: error: expected ')' before numeric constant
   73 |   enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
      |                           ~^
      |                            )
/usr/include/c++/14/bits/stl_bvector.h:78:3: error: variable or field '__fill_bvector_n' declared void
   78 |   __fill_bvector_n(_Bit_type*, size_t, bool) _GLIBCXX_NOEXCEPT;
      |   ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:78:20: error: '_Bit_type' was not declared in this scope; did you mean 'std::_Bit_type'?
   78 |   __fill_bvector_n(_Bit_type*, size_t, bool) _GLIBCXX_NOEXCEPT;
      |                    ^~~~~~~~~
      |                    std::_Bit_type
/usr/include/c++/14/bits/stl_bvector.h:72:25: note: 'std::_Bit_type' declared here
   72 |   typedef unsigned long _Bit_type;
      |                         ^~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:78:30: error: expected primary-expression before ',' token
   78 |   __fill_bvector_n(_Bit_type*, size_t, bool) _GLIBCXX_NOEXCEPT;
      |                              ^
/usr/include/c++/14/bits/stl_bvector.h:78:38: error: expected primary-expression before ',' token
   78 |   __fill_bvector_n(_Bit_type*, size_t, bool) _GLIBCXX_NOEXCEPT;
      |                                      ^
/usr/include/c++/14/bits/stl_bvector.h:78:40: error: expected primary-expression before 'bool'
   78 |   __fill_bvector_n(_Bit_type*, size_t, bool) _GLIBCXX_NOEXCEPT;
      |                                        ^~~~
/usr/include/c++/14/bits/stl_bvector.h:84:5: error: '_Bit_type' does not name a type
   84 |     _Bit_type * _M_p;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:85:5: error: '_Bit_type' does not name a type
   85 |     _Bit_type _M_mask;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:88:29: error: expected ')' before '*' token
   88 |     _Bit_reference(_Bit_type * __x, _Bit_type __y)
      |                   ~         ^~
      |                             )
/usr/include/c++/14/bits/stl_bvector.h: In constructor '_Bit_reference::_Bit_reference()':
/usr/include/c++/14/bits/stl_bvector.h:92:42: error: class '_Bit_reference' does not have any field named '_M_p'
   92 |     _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { }
      |                                          ^~~~
/usr/include/c++/14/bits/stl_bvector.h:92:51: error: class '_Bit_reference' does not have any field named '_M_mask'
   92 |     _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { }
      |                                                   ^~~~~~~
/usr/include/c++/14/bits/stl_bvector.h: In member function '_Bit_reference::operator bool() const':
/usr/include/c++/14/bits/stl_bvector.h:100:18: error: '_M_p' was not declared in this scope
  100 |     { return !!(*_M_p & _M_mask); }
      |                  ^~~~
/usr/include/c++/14/bits/stl_bvector.h:100:25: error: '_M_mask' was not declared in this scope; did you mean 'fd_mask'?
  100 |     { return !!(*_M_p & _M_mask); }
      |                         ^~~~~~~
      |                         fd_mask
/usr/include/c++/14/bits/stl_bvector.h: In member function '_Bit_reference& _Bit_reference::operator=(bool)':
/usr/include/c++/14/bits/stl_bvector.h:107:10: error: '_M_p' was not declared in this scope
  107 |         *_M_p |= _M_mask;
      |          ^~~~
/usr/include/c++/14/bits/stl_bvector.h:107:18: error: '_M_mask' was not declared in this scope; did you mean 'fd_mask'?
  107 |         *_M_p |= _M_mask;
      |                  ^~~~~~~
      |                  fd_mask
/usr/include/c++/14/bits/stl_bvector.h:109:10: error: '_M_p' was not declared in this scope
  109 |         *_M_p &= ~_M_mask;
      |          ^~~~
/usr/include/c++/14/bits/stl_bvector.h:109:19: error: '_M_mask' was not declared in this scope; did you mean 'fd_mask'?
  109 |         *_M_p &= ~_M_mask;
      |                   ^~~~~~~
      |                   fd_mask
/usr/include/c++/14/bits/stl_bvector.h: In member function 'void _Bit_reference::flip()':
/usr/include/c++/14/bits/stl_bvector.h:143:8: error: '_M_p' was not declared in this scope
  143 |     { *_M_p ^= _M_mask; }
      |        ^~~~
/usr/include/c++/14/bits/stl_bvector.h:143:16: error: '_M_mask' was not declared in this scope; did you mean 'fd_mask'?
  143 |     { *_M_p ^= _M_mask; }
      |                ^~~~~~~
      |                fd_mask
/usr/include/c++/14/bits/stl_bvector.h: At global scope:
/usr/include/c++/14/bits/stl_bvector.h:181:5: error: '_Bit_type' does not name a type
  181 |     _Bit_type * _M_p;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:195:33: error: expected ')' before '*' token
  195 |     _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
      |                       ~         ^~
      |                                 )
/usr/include/c++/14/bits/stl_bvector.h: In member function 'void _Bit_iterator_base::_M_assume_normalized() const':
/usr/include/c++/14/bits/stl_bvector.h:190:53: error: '_S_word_bit' was not declared in this scope; did you mean 'std::_S_word_bit'?
  190 |       __attribute__ ((__assume__ (__ofst < unsigned(_S_word_bit))));
      |                                                     ^~~~~~~~~~~
      |                                                     std::_S_word_bit
/usr/include/c++/14/bits/stl_bvector.h:73:10: note: 'std::_S_word_bit' declared here
   73 |   enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
      |          ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h: In member function 'void _Bit_iterator_base::_M_bump_up()':
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:3:13: error: expected ')' before 'long'
/usr/include/c++/14/bits/stl_bvector.h:203:10: note: to match this '('
  203 |       if (_M_offset++ == int(_S_word_bit) - 1)
      |          ^
/usr/include/c++/14/bits/stl_bvector.h:206:13: error: '_M_p' was not declared in this scope
  206 |           ++_M_p;
      |             ^~~~
/usr/include/c++/14/bits/stl_bvector.h: In member function 'void _Bit_iterator_base::_M_bump_down()':
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/stl_bvector.h:218:13: error: '_M_p' was not declared in this scope
  218 |           --_M_p;
      |             ^~~~
/usr/include/c++/14/bits/stl_bvector.h: In member function 'void _Bit_iterator_base::_M_incr(ptrdiff_t)':
/usr/include/c++/14/bits/stl_bvector.h:228:7: error: '_M_p' was not declared in this scope
  228 |       _M_p += __n / int(_S_word_bit);
      |       ^~~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/stl_bvector.h: In function 'bool operator==(const _Bit_iterator_base&, const _Bit_iterator_base&)':
/usr/include/c++/14/bits/stl_bvector.h:244:18: error: 'const struct _Bit_iterator_base' has no member named '_M_p'
  244 |       return __x._M_p == __y._M_p && __x._M_offset == __y._M_offset;
      |                  ^~~~
/usr/include/c++/14/bits/stl_bvector.h:244:30: error: 'const struct _Bit_iterator_base' has no member named '_M_p'
  244 |       return __x._M_p == __y._M_p && __x._M_offset == __y._M_offset;
      |                              ^~~~
/usr/include/c++/14/bits/stl_bvector.h: In function 'bool operator<(const _Bit_iterator_base&, const _Bit_iterator_base&)':
/usr/include/c++/14/bits/stl_bvector.h:266:18: error: 'const struct _Bit_iterator_base' has no member named '_M_p'
  266 |       return __x._M_p < __y._M_p
      |                  ^~~~
/usr/include/c++/14/bits/stl_bvector.h:266:29: error: 'const struct _Bit_iterator_base' has no member named '_M_p'
  266 |       return __x._M_p < __y._M_p
      |                             ^~~~
/usr/include/c++/14/bits/stl_bvector.h:267:21: error: 'const struct _Bit_iterator_base' has no member named '_M_p'
  267 |             || (__x._M_p == __y._M_p && __x._M_offset < __y._M_offset);
      |                     ^~~~
/usr/include/c++/14/bits/stl_bvector.h:267:33: error: 'const struct _Bit_iterator_base' has no member named '_M_p'
  267 |             || (__x._M_p == __y._M_p && __x._M_offset < __y._M_offset);
      |