Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 1001001001;

int main(){
	int n, t; cin >> n >> t;
	vector<pl> ab(n); rep(i,n) cin >> ab[i].first >> ab[i].second;
	sort(all(ab));
	vector<vi> dp(n+1, vi(t+1, 0));
	dp[0][0] = 0;
	rep(i, n){
		rep(j, t){
			dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
		}
	}
	ll ans = 0;
	rep(i,t+1){
		ans = max(ans, dp[n][i]);
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:36: error: no matching function for call to 'min(int&, long long int)'
   23 |                         dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
      |                                 ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:23:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   23 |                         dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
      |                                 ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:23:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |                         dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
      |                                 ~~~^~~~~~~~~~~~~~~~~~
a.cc:23:71: error: no matching function for call to 'min(int&, long long int)'
   23 |                         dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
      |                                                                    ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:23:71: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   23 |                         dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
      |                                                                    ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:23:71: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |                         dp[i+1][min(t, j+ab[i].first)] = max(dp[i][min(t,j+ab[i].first)], dp[i][j]+ab[i].second);
      |                                                                    ~~~^~~~~~~~~~~~~~~~~
a.cc:28:26: error: no matching function for call to 'max(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   28 |                 ans = max(ans, dp[n][i]);
      |                       ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:28:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   28 |                 ans = max(ans, dp[n][i]);
      |                       ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:28:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |                 ans = max(ans, dp[n][i]);
      |                       ~~~^~~~~~~~~~~~~~~