Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

signed main() {
    int n, k;
    cin >> n >> k;
    ll a[n];
    rep(i, n) {
        cin >> a[i];
    }
    if (n > 400 || k > 400) return 0;
    int ans = n;
    rep(i, n) {
        vector<ll> t;
        rep(j, n) {
            if (i == j) continue;
            t.emplace_back(a[j]);
        }
        bool dp[n][k];
        fill(dp[0], dp[n], false);
        dp[0][0] = true;
        rep(j, n - 1) {
            rep(l, k) {
                if (dp[j][l]) {
                    dp[j + 1][l] = true;
                    if (l + t[j] >= k) continue;
                    dp[j + 1][l + t[j]] = true;
                }
            }
        }
        for (int j = max(0, k - a[i]); j < k; j++) {
            if (dp[n - 1][j]) {
                ans--;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:25: error: no matching function for call to 'max(int, ll)'
   38 |         for (int j = max(0, k - a[i]); j < k; j++) {
      |                      ~~~^~~~~~~~~~~~~
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: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:38:25: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   38 |         for (int j = max(0, k - a[i]); j < k; j++) {
      |                      ~~~^~~~~~~~~~~~~
/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
In file included from /usr/include/c++/14/algorithm:61:
/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:38:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   38 |         for (int j = max(0, k - a[i]); j < k; j++) {
      |                      ~~~^~~~~~~~~~~~~