Language: C++

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

/*-------------------Define Start-------------------*/
typedef bool BL;    					// 布尔类型
typedef char SB;    					// 有符号1字节,8位
typedef unsigned char UB;    			// 无符号1字节,8位
typedef short SW;    					// 有符号短整型,16位
typedef unsigned short UW;    			// 无符号短整型,16位
typedef long SDW;    					// 有符号整型,32位
typedef unsigned long UDW;   			// 无符号整型,32位
typedef long long SLL;    				// 有符号长整型,64位
typedef unsigned long long ULL;			// 无符号长整型,64位
typedef char CH;    					// 单个字符
typedef float R32;    					// 单精度浮点数
typedef double R64;    					// 双精度浮点数

#define Rep(i, n) for (register SDW i = 0; i < (n); ++i)
#define For(i, s, t) for (register SDW i = (s); i <= (t); ++i)
#define rFor(i, t, s) for (register SDW i = (t); i >= (s); --i)
#define foreach(i, c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); ++i)
#define ms0(a) memset(a,0,sizeof(a))
#define msI(a) memset(a,0x7f,sizeof(a))
#define LOWBIT(x) ((x)&(-x))

#define MP make_pair
#define PB push_back
#define ft first
#define sd second

#define pr(x) cout << #x << " = " << x << "  "
#define prln(x) cout << #x << " = " << x << endl

const ULL mod = 998244353;				//常用模数(可根据题目需要修改)
const ULL inf = 0x7fffffff;				//用来表示无限大
const ULL infLL = 0x7fffffffffffffffLL;	//用来表示无限大
/*-------------------Define End-------------------*/

const UDW maxN = 3e3 + 7;
SDW N, S;
SDW A[maxN];
SLL dp[maxN][maxN][3];
SLL ans;

void input(){
	cin >> N >> S;
	For(i, 1, N) {
		cin >> A[i];
	}
}

void solve(){
	For(i, 1, N) {
		For(j, 1, S) {
			dp[i][j][0] = dp[i - 1][j][2];
			dp[i][j][1] = dp[i - 1][j][1];
			dp[i][j][2] = dp[i - 1][j][2];
			if(A[i] <= j) {
				dp[i][j][1] += dp[i - 1][j - A[i]][1]；
				dp[i][j][2] += dp[i - 1][j - A[i]][2]；
				dp[i][j][1] %= mod;
				dp[i][j][2] %= mod;
			}
		}
	}
	ans = dp[N][S][2];
}

void output(){
	cout << ans << endl;
}

int main() {
	input();
	solve();
	output();
	return 0;
}

Compiler output:
a.cc: In function 'void input()':
a.cc:47:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   47 |         For(i, 1, N) {
      |             ^
a.cc:19:40: note: in definition of macro 'For'
   19 | #define For(i, s, t) for (register SDW i = (s); i <= (t); ++i)
      |                                        ^
a.cc: In function 'void solve()':
a.cc:53:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   53 |         For(i, 1, N) {
      |             ^
a.cc:19:40: note: in definition of macro 'For'
   19 | #define For(i, s, t) for (register SDW i = (s); i <= (t); ++i)
      |                                        ^
a.cc:54:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   54 |                 For(j, 1, S) {
      |                     ^
a.cc:19:40: note: in definition of macro 'For'
   19 | #define For(i, s, t) for (register SDW i = (s); i <= (t); ++i)
      |                                        ^
a.cc:59:70: error: expected ';' before '\U0000ff1b'
   59 |                                 dp[i][j][1] += dp[i - 1][j - A[i]][1]；
      |                                                                      ^~
      |                                                                      ;