Language: C++

#include<bits/stdc++.h>
using namespace std;

long long ara[3009],n,data[3009],s,mod=998244353,dp[3002][3002];

long long solve(long long idx,long long cap,long long val)
{


     if(cap==0)
     {
        dp[idx][cap]=data[n-val]; return dp[idx][cap];
     }
     else if(idx>n)return 0;
     //else if(dp[idx][cap]!=-1)return dp[idx][cap];
     else
     {
         long long p=0,q=0;

         if(cap-ara[idx]>=0){p=solve(idx+1,cap-ara[idx],val+1);  }
         q=solve(idx+1,cap,val);

         dp[idx][cap]=(p+q)%mod;  return dp[idx][cap];
     }


}

int main()
{

    long long d,i,j,k,ans;
    scanf("%lld %lld",&n,&s);

    data[0]=1;
    for(i=1;i<=n;i++)
    {
        scanf("%lld",&ara[i]);

        data[i]=(data[i-1]*2)%mod;

    }

    memset(dp,-1,sizeof dp);
    ans=solve(1,s,0);

    printf("%lld\n",ans);

    return 0;
}


Compiler output:
a.cc: In function 'long long int solve(long long int, long long int, long long int)':
a.cc:12:22: error: reference to 'data' is ambiguous
   12 |         dp[idx][cap]=data[n-val]; return dp[idx][cap];
      |                      ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:23: note:                 'long long int data [3009]'
    4 | long long ara[3009],n,data[3009],s,mod=998244353,dp[3002][3002];
      |                       ^~~~
a.cc: In function 'int main()':
a.cc:35:5: error: reference to 'data' is ambiguous
   35 |     data[0]=1;
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:23: note:                 'long long int data [3009]'
    4 | long long ara[3009],n,data[3009],s,mod=998244353,dp[3002][3002];
      |                       ^~~~
a.cc:40:9: error: reference to 'data' is ambiguous
   40 |         data[i]=(data[i-1]*2)%mod;
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:23: note:                 'long long int data [3009]'
    4 | long long ara[3009],n,data[3009],s,mod=998244353,dp[3002][3002];
      |                       ^~~~
a.cc:40:18: error: reference to 'data' is ambiguous
   40 |         data[i]=(data[i-1]*2)%mod;
      |                  ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:23: note:                 'long long int data [3009]'
    4 | long long ara[3009],n,data[3009],s,mod=998244353,dp[3002][3002];
      |                       ^~~~