Language: C++

#include<bits/stdc++.h>
using namespace std;
#define inf 1e9+1
long long int solve(vector<pair<long long int,long long int>> items,long long int n,long long int s)
{
	long long int dp[105][100005];
	for(long long int i=0;i<n;i++)
	{
		for(long long int j=0;j<n;j++)
		{
			dp[i][j]=inf;
		}
		dp[i][0]=0;
	}
	dp[0][items[0].second]=items[0].first;
  

for(long long int i=1;i<n;i++)
{
	for(long long int j=1;j<n*1000;j++)
    {
      dp[i][j]=dp[i-1][j];
      if(items[i].first<=j)
      {
       dp[i][j]=min(dp[i-1][j],items[i].first+dp[i-1][j-items[i].first]) 
      }
	}
}
  long long int ans=0;
  for(long long int i=0;i<n*1000;i++)
  {
    if(dp[n-1][i]<=s)
    {
      ans=dp[n-1][i];
    }
    return ans;
  }
  }
int main() {
	long long int n,s;
	cin>>n>>s;
	vector<long long int,long long int> items;
	for(long long int i=0;i<n;i++)
	{
		long long int temp1,temp2;
		cin>>temp1>>temp2;
		items.push_back(make_pair(temp1,temp2));
	}
	cout<<solve(items,n,s);

	return 0;
}

Compiler output:
a.cc: In function 'long long int solve(std::vector<std::pair<long long int, long long int> >, long long int, long long int)':
a.cc:25:73: error: expected ';' before '}' token
   25 |        dp[i][j]=min(dp[i-1][j],items[i].first+dp[i-1][j-items[i].first])
      |                                                                         ^
      |                                                                         ;
   26 |       }
      |       ~                                                                  
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 long int, long long int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<long long int, long long int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:42:38:   required from here
   42 |         vector<long long int,long long int> items;
      |                                             ^~~~~
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'long 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 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 long int, long long int>':
a.cc:42:38:   required from here
   42 |         vector<long long int,long long int> items;
      |                                             ^~~~~
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<long long int, long 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 long int, long 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 long int, long long int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = long long int; _Alloc = long long int]':
a.cc:42:38:   required from here
   42 |         vector<long long int,long long int> items;
      |                                             ^~~~~
/usr/include/c++/14/bits/stl_vector.h:136:24: error: 'long long int' is not a class, struct, or union type
  136 |         _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
      |                        ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:47:32: error: no matching function for call to 'std::vector<long long int, long long int>::push_back(std::pair<long long int, long long int>)'
   47 |                 items.push_back(make_pair(temp1,temp2));
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = long long int; value_type = long long int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::pair<long long int, long long int>' to 'const std::vector<long long int, long long int>::value_type&' {aka 'const long long int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = long long int; value_type = long long int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::pair<long long int, long long int>' to 'std::vector<long long int, long long int>::value_type&&' {aka 'long long int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:49:21: error: could not convert 'items' from 'vector<long long int,long long int>' to 'vector<std::pair<long long int, long long int>,std::allocator<std::pair<long long int, long long int> >>'
   49 |         cout<<solve(items,n,s);
      |                     ^~~~~
      |                     |
      |                     vector<long long int,long long int>
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = long long int; _Alloc = long long int]':
/usr/include/c++/14/bits/stl_vector.h:314:7:   required from here
  314 |       _Vector_base() = default;
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:141:26: error: 'long long int' is not a class, struct, or union type
  141 |         : _Tp_alloc_type()
      |                          ^
a.cc: In function 'long long int solve(std::vector<std::pair<long long int, long long int> >, long long int, long long int)':
a.cc:38:3: warning: control reaches end of non-void function [-Wreturn-type]
   38 |   }
      |   ^