criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int N,S;long long x;cin>>N>>S;
    vector<int>a(N);for(int i=0;i<N;i++)cin>>a.at(i);
   sort(a.begin(),a.end());
 for(int i=0;i<N;i++){int p=0,q=i;while(p<S){p+=a.at(i);i++;}
if(p==S){int m=N-q+i-1;long long t=1;
         for(int j=0;j<m;j++){t*=2;t%=998244353;}
x+=t;x%=998244353;}cout<<x<<endl;}
         


Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: expected '}' at end of input
    9 | x+=t;x%=998244353;}cout<<x<<endl;}
      |                                   ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int N,S;long long x;cin>>N>>S;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int N,S;long long x;cin>>N>>S;
    vector<int>a(N);for(int i=0;i<N;i++)cin>>a.at(i);
   sort(a.begin(),a.end());
 for(int i=0;i<N;i++){int p=0,q=i;while(p<S){p+=a.at(i);i++;}
if(p==S){int m=N-q+i-1;long long t=1;
         for(int j=0;j<m;j++){t*=2;t%=998244353;}
x+=t;x%=998244353}cout<<x<<endl;}
         


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '}' token
    9 | x+=t;x%=998244353}cout<<x<<endl;}
      |                  ^
      |                  ;
a.cc:9:34: error: expected '}' at end of input
    9 | x+=t;x%=998244353}cout<<x<<endl;}
      |                                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int N,S;long long x;cin>>N>>S;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int N,S;long long x;cin>>N>>S;
    vector<int>a(N);for(int i=0;i<N;i++)cin>>a.at(i);
   sort(a.begin(),a.end());
 for(int i=0;i<N;i++){int p=0,q=i;while(p<S){p+=a.at(i);i++}
if(p==S){int m=N-q+i-1;long long t=1;
         for(int j=0;j<m;j++){t*=2;t%=998244353;}
x+=t;x%=998244353}cout<<x<<endl;}
         

Compiler output:
a.cc: In function 'int main()':
a.cc:6:60: error: expected ';' before '}' token
    6 |  for(int i=0;i<N;i++){int p=0,q=i;while(p<S){p+=a.at(i);i++}
      |                                                            ^
      |                                                            ;
a.cc:9:18: error: expected ';' before '}' token
    9 | x+=t;x%=998244353}cout<<x<<endl;}
      |                  ^
      |                  ;
a.cc:9:34: error: expected '}' at end of input
    9 | x+=t;x%=998244353}cout<<x<<endl;}
      |                                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int N,S;long long x;cin>>N>>S;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int N,S;long long x;cin>>N>>S;
    vector<int>a(N);for(int i=0;i<N;i++)cin>>a.at(i);
   sort(a.begin(),a.end());
 for(i=0;i<N;i++){int p=0,q=i;while(p<S){p+=a.at(i);i++}
if(p==S){int m=N-q+i-1;long long t=1;
         for(int j=0;j<m;j++){t*=2;t%=998244353;}
x+=t;x%=998244353}cout<<x<<endl;}
         

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'i' was not declared in this scope
    6 |  for(i=0;i<N;i++){int p=0,q=i;while(p<S){p+=a.at(i);i++}
      |      ^
a.cc:9:18: error: expected ';' before '}' token
    9 | x+=t;x%=998244353}cout<<x<<endl;}
      |                  ^
      |                  ;
a.cc:9:34: error: expected '}' at end of input
    9 | x+=t;x%=998244353}cout<<x<<endl;}
      |                                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int N,S;long long x;cin>>N>>S;
      |           ^
Language: C++

#include <iostream>
using namespace std;

const lld mod = 998244353;
int arr[3333];
lld dp[3333];
int main() {
	// your code goes here
	int n;
	scanf("%d",&n);
	for(int e=0;e<n;e++) cin >> arr[e];
	dp[0] = 1;
	for(int e=0;e<n;e++){
		for(int p=s;p>=arr[e];p--){
			dp[p] = (dp[p]+dp[p-arr[e]])%mod;
			dp[p-arr[e]] = (dp[p-arr[e]]*(lld)2)%mod;
		}
	}
	printf("%lld\n",dp[s]);
	return 0;
}

Compiler output:
a.cc:4:7: error: 'lld' does not name a type
    4 | const lld mod = 998244353;
      |       ^~~
a.cc:6:1: error: 'lld' does not name a type
    6 | lld dp[3333];
      | ^~~
a.cc: In function 'int main()':
a.cc:12:9: error: 'dp' was not declared in this scope
   12 |         dp[0] = 1;
      |         ^~
a.cc:14:27: error: 's' was not declared in this scope
   14 |                 for(int p=s;p>=arr[e];p--){
      |                           ^
a.cc:15:54: error: 'mod' was not declared in this scope
   15 |                         dp[p] = (dp[p]+dp[p-arr[e]])%mod;
      |                                                      ^~~
a.cc:16:55: error: 'lld' was not declared in this scope
   16 |                         dp[p-arr[e]] = (dp[p-arr[e]]*(lld)2)%mod;
      |                                                       ^~~
a.cc:16:59: error: expected ')' before numeric constant
   16 |                         dp[p-arr[e]] = (dp[p-arr[e]]*(lld)2)%mod;
      |                                        ~                  ^
      |                                                           )
a.cc:19:28: error: 's' was not declared in this scope
   19 |         printf("%lld\n",dp[s]);
      |                            ^
Language: C++

#include<iostream>
using namespace std;
const long long INIT = -1;
const long long MOD = 998244353;
long long dp[3001][3001];
int _array[3005];
long long fact[3005];
long long dfs(int n,int value);
int main(){
  int n;
  int sum;
  cin>>n>>sum;
  fact[0]=1;
  for(int i=1;i<=n;i++){
    cin>>_array[i];
    fact[i]=fact[i-1]*i;
  }
  
  for(int i=0;i<=n;i++){
    for(int j=0;j<=sum;j++){
      dp[i][j]=INIT;
    }
  }
  
  cout<<dfs(n,sum)<<endl;
  return(0);
}

long long dfs(int n,int value){
  if(n==0){
    if(value==0){
      return(1);
    }else{
      return(0);
    }
  }
  if(dp[n][value]!=INIT){
    return(dp[n][value]);
  }
  
  long long s=dfs(n-1,value)*2%MOD;
  if(value>=_array[n]){
    s=(s+dfs(n-1,value-_array[n]%MDO))%MOD;
  }
  //  cout<<"n:"<<n<<endl;
  //  cout<<"s:"<<s<<endl<<endl;
  return(dp[n][value]=s);
}

Compiler output:
a.cc: In function 'long long int dfs(int, int)':
a.cc:43:34: error: 'MDO' was not declared in this scope; did you mean 'MOD'?
   43 |     s=(s+dfs(n-1,value-_array[n]%MDO))%MOD;
      |                                  ^~~
      |                                  MOD
Language: C++

unsigned long long int add(unsigned int additional);
void hoge(aaaa aaa, unsigned int iterator);

unsigned int n;
unsigned int s;
unsigned int a[3000];

int main() {
	cin >> n >> s;
	for (unsigned int i = 0; i < n; i++)	cin >> a[i];

	aaaa aaa(0, 0);
	hoge(aaa, 0);

	cout << add(0);

	return 0;
}

unsigned long long int add(unsigned int additional) {
	static unsigned long long int ans = 0;

	ans += additional;

	if (ans > LIMIT) {
		ans %= LIMIT;
	}

	return ans;
}

void hoge(aaaa aaa, unsigned int iterator) {
	for (; iterator < n; iterator++) {
		if (aaa.total + a[iterator] == s) {
			add((unsigned int)pow(2, (n - aaa.count -1)));
		}
		else if (aaa.total + a[iterator] < s) {
			aaaa bbb(aaa.count + 1, aaa.total + a[iterator]);
			hoge(bbb, iterator + 1);
		}
	}
}

Compiler output:
a.cc:2:6: error: variable or field 'hoge' declared void
    2 | void hoge(aaaa aaa, unsigned int iterator);
      |      ^~~~
a.cc:2:11: error: 'aaaa' was not declared in this scope
    2 | void hoge(aaaa aaa, unsigned int iterator);
      |           ^~~~
a.cc:2:21: error: expected primary-expression before 'unsigned'
    2 | void hoge(aaaa aaa, unsigned int iterator);
      |                     ^~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> n >> s;
      |         ^~~
a.cc:12:9: error: 'aaaa' was not declared in this scope
   12 |         aaaa aaa(0, 0);
      |         ^~~~
a.cc:13:14: error: 'aaa' was not declared in this scope
   13 |         hoge(aaa, 0);
      |              ^~~
a.cc:13:9: error: 'hoge' was not declared in this scope
   13 |         hoge(aaa, 0);
      |         ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << add(0);
      |         ^~~~
a.cc: In function 'long long unsigned int add(unsigned int)':
a.cc:25:19: error: 'LIMIT' was not declared in this scope
   25 |         if (ans > LIMIT) {
      |                   ^~~~~
a.cc: At global scope:
a.cc:32:6: error: variable or field 'hoge' declared void
   32 | void hoge(aaaa aaa, unsigned int iterator) {
      |      ^~~~
a.cc:32:11: error: 'aaaa' was not declared in this scope
   32 | void hoge(aaaa aaa, unsigned int iterator) {
      |           ^~~~
a.cc:32:21: error: expected primary-expression before 'unsigned'
   32 | void hoge(aaaa aaa, unsigned int iterator) {
      |                     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, s;
    cin >> n >> s;
    ll a[n+1];
    for(int i=1;i<=n;i++){
    	cin >> a[i];
    }
    vector<vector<mint> > dp(n+1, vector<mint> (s+1, 0));
    dp[0][0] = mint(2).pow(n);
    for(int i=1;i<=n;i++){
    	for(int j=0;j<=s;j++){
    		if(j>=a[i])dp[i][j] += dp[i-1][j - a[i]] / mint(2);
    		dp[i][j] += dp[i-1][j];
    	}
    }
    ll m = ll(dp[n][s]);
    cout << modpow(2LL)
    cout << dp[n][s] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:12: error: invalid cast from type '__gnu_cxx::__alloc_traits<std::allocator<mint>, mint>::value_type' {aka 'mint'} to type 'll' {aka 'long long int'}
   59 |     ll m = ll(dp[n][s]);
      |            ^~~~~~~~~~~~
a.cc:60:13: error: 'modpow' was not declared in this scope
   60 |     cout << modpow(2LL)
      |             ^~~~~~
Language: C++

#include<vector>
#include<cstdio>
#include<queue>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define MOD 998244353LL
#define N 4096
ll p[N][N] = {{1}}, q[N][N] = {{1}};

int main(){
	int n, s; scanf("%d%d", &n, &s);
	REP(i, n){
		int a; scanf("%d", &a);
		REP(j, s+1){
			p[i+1][j] = (p[i+1][j] + p[i][j]) % MOD;
			q[i+1][j] = (q[i+1][j] + q[i][j] * 2) % MOD;
			if(j + a <= s){
				p[i+1][j+a] = (p[i+1][j+a] + p[i][j]) % MOD;
				q[i+1][j+a] = (q[i+1][j+a] + q[i][j]) % MOD;
			}
		}
	}
	printf("%lld\n", q[n][s]);
}


Compiler output:
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C++

// Author: HarshKumar
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll N = 1e6 + 6, M = 998244353;
bool dp[3009][3009];

ll ans, nn;
ll pp[3009] = {1};
void display(const vector<ll> &v)
{
    ans = (ans + pp[2, nn - v.size()]) % M;
}
void printSubsetsRec(ll arr[], ll i, ll sum, vector<ll> &p)
{
    if (i == 0 && sum != 0 && dp[0][sum])
    {
        p.push_back(arr[i]);
        display(p);
        return;
    }
    if (i == 0 && sum == 0)
    {
        display(p);
        return;
    }
    if (dp[i - 1][sum])
    {
        vector<ll> b = p;
        printSubsetsRec(arr, i - 1, sum, b);
    }
    if (sum >= arr[i] && dp[i - 1][sum - arr[i]])
    {
        p.push_back(arr[i]);
        printSubsetsRec(arr, i - 1, sum - arr[i], p);
    }
}
void printAllSubsets(ll arr[], ll n, ll sum)
{
    if (n == 0 || sum < 0)
        return;
    for (ll i = 0; i < n; ++i)
    {
        dp[i][0] = true;
    }
    if (arr[0] <= sum)
        dp[0][arr[0]] = true;
    for (ll i = 1; i < n; ++i)
        for (ll j = 0; j < sum + 1; ++j)
            dp[i][j] = (arr[i] <= j) ? (dp[i - 1][j] || dp[i - 1][j - arr[i]]) : dp[i - 1][j];
    if (dp[n - 1][sum] == false)
    {
        return;
    }
    vector<ll> p;
    printSubsetsRec(arr, n - 1, sum, p);
}
ll a[5000];
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll s;
    for (ll i = 1; i < 3009; i++)
        pp[i] = (pp[i - 1] * 2) % M;
    cin >> nn >> s;
    for (ll i = 0; i < nn; i++)
        cin >> a[i];
    printAllSubsets(a, nn, s);
    cout << ans;
}

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:5:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long int, std::allocator<long int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
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:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#include<vector>
#include<cstdio>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define MOD 998244353LL
#define N 4096
ll p[N][N] = {{1}}, q[N][N] = {{1}};

int main(){
	int n, s; scanf("%d%d", &n, &s);
	REP(i, n){
		int a; scanf("%d", &a);
		REP(j, s+1){
			p[i+1][j] = (p[i+1][j] + p[i][j]) % MOD;
			q[i+1][j] = (q[i+1][j] + q[i][j] * 2) % MOD;
			if(j + a <= s){
				p[i+1][j+a] = (p[i+1][j+a] + p[i][j]) % MOD;
				q[i+1][j+a] = (q[i+1][j+a] + q[i][j]) % MOD;
			}
		}
	}
	printf("%lld\n", q[n][s]);
}


Compiler output:
a.cc:15:14: error: 'priority_queue' does not name a type
   15 | using pque = priority_queue<T, vector<T>, greater<T>>;
      |              ^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long gyaku(long n,long p){
    return modpow(n,p-2,p);
}



int main(){
    int n,s;
    cin >> n >> s;
    long a[n];
    for(int i=0;i<n;i++)cin >> a[i];
    long const mod = 998244353;

    
    sort(a,a+n,greater<long>());

    long pow2[n+1];
    pow2[0] = 1;
    for(int i=1;i<=n;i++)pow2[i] = (pow2[i-1]*2)%mod;

    vector<vector<long> >dp(n+1,<vector<long>(s+1));
    dp[0][0] = pow2[n];
    
    for(int i=0;i<n;i++){
        for(int j=s;j>=a[i];j--){
            dp[i+1][j] = dp[i][j-a[i]] * gyaku(2,mod);
        }
    }

    cout << dp[n][s];

    
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:33: error: expected primary-expression before '<' token
   34 |     vector<vector<long> >dp(n+1,<vector<long>(s+1));
      |                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long int ll;
typedef string str;
vector<ll> nik;
bool** dp; 
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 

void printSubsetsRec(ll arr[], ll i, ll sum, vector<int>& p) 
{ 
    if (i == 0 && sum != 0 && dp[0][sum]) 
    { 
        p.pb(arr[i]); 
        nik.pb(p.size()); 
        return; 
    } 
  
    if (i == 0 && sum == 0) 
    { 
        nik.pb(p.size()); 
        return; 
    } 
  
    if (dp[i-1][sum]) 
    { 
        vector<ll> b ;
        for(ll z=0;z<p.size();z++)
        {
        	b.pb(p[z]);
        } 
        printSubsetsRec(arr, i-1, sum, b); 
    } 
  
    if (sum >= arr[i] && dp[i-1][sum-arr[i]]) 
    { 
        p.pb(arr[i]); 
        printSubsetsRec(arr, i-1, sum-arr[i], p); 
    } 
} 
  
// Prints all subsets of arr[0..n-1] with sum 0. 
void printAllSubsets(ll arr[], ll n, ll sum) 
{ 
    if (n == 0 || sum < 0) 
       return; 
  
    dp = new bool*[n]; 
    for (ll i=0; i<n; ++i) 
    { 
        dp[i] = new bool[sum + 1]; 
        dp[i][0] = true; 
    } 
  
    // Sum arr[0] can be achieved with single element 
    if (arr[0] <= sum) 
       dp[0][arr[0]] = true; 
  
    // Fill rest of the entries in dp[][] 
    for (ll i = 1; i < n; ++i) 
        for (ll j = 0; j < sum + 1; ++j) 
            dp[i][j] = (arr[i] <= j) ? dp[i-1][j] || 
                                       dp[i-1][j-arr[i]] 
                                     : dp[i - 1][j]; 
    if (dp[n-1][sum] == false) 
    { 
        return; 
    } 
  
    // Now recursively traverse dp[][] to find all 
    // paths from dp[n-1][sum] 
    vector<int> p; 
    printSubsetsRec(arr, n-1, sum, p); 
} 

int main ()
{
	// ios::sync_with_stdio(0);
 //    cin.tie(0);
 //    cout.tie(0);
	ll t,n,m,k,i,a,b,j;
	cin >> n >> m;
	a=998244353;
	ll arr[n+2];
	for(i=0;i<n;i++)
	{
		cin >> arr[i];
	}
	printAllSubsets(arr, n, m);
	b=0;
	for(i=0;i<nik.size();i++)
	{
		t=n-nik[i];
		b=(b+power(2,t,a))%a;
	}
	cout << b << "\n"; 
	return 0;
}

Compiler output:
a.cc: In function 'void printSubsetsRec(ll*, ll, ll, std::vector<int>&)':
a.cc:45:40: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
   45 |         printSubsetsRec(arr, i-1, sum, b);
      |                                        ^
a.cc:23:59: note: in passing argument 4 of 'void printSubsetsRec(ll*, ll, ll, std::vector<int>&)'
   23 | void printSubsetsRec(ll arr[], ll i, ll sum, vector<int>& p)
      |                                              ~~~~~~~~~~~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define MOD 998244353LL
#define N 4096
ll p[N][N] = {{1}}, q[N][N] = {{1}};

int main(){
	int n, s; scanf("%d%d", &n, &s);
	REP(i, n){
		int a; scanf("%d", &a);
		REP(j, s+1){
			p[i+1][j] = (p[i+1][j] + p[i][j]) % MOD;
			q[i+1][j] = (q[i+1][j] + q[i][j] * 2) % MOD;
			if(j + a <= s){
				p[i+1][j+a] = (p[i+1][j+a] + p[i][j]) % MOD;
				q[i+1][j+a] = (q[i+1][j+a] + q[i][j]) % MOD;
			}
		}
	}
	printf("%lld\n", q[n][s]);
}


Compiler output:
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//const int mod = 1e9 + 7;
const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;//n乗を効率的に求める
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

mint f(int n) {
  if (n == 0) return 1;
  mint x = f(n/2);
  x *= x;
  if (n%2 == 1) x *= 2;
  return x;
}

mint choose(int n, int a) {
  mint x = 1, y = 1;
  rep(i,a) {
    x *= n-i;
    y *= i+1;
  }
  return x / y;
}
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};



int dp[3000][3000];

int main() {
    int n s;
    cin >> n >> s;
    vector<int> a(n);
    vector<mint> vec(3005);
    vec[0]=1;
    rep(i,3005) vec[i+1]=vec[i]*2;
    rep(i,n) cin >> a[i];
    rep(i,n) dp[1][a[i]]=1;
    for(int i=2; i<n+1; i++) {
        rep(j,s+1) {
            rep(k,n) {
                if(j<=a[i]) continue;
                dp[i][j]+=dp[i-1][j-a[i]];
            }
        }
    }
    mint ans=0;
    for(int i=1; i<n+1; i++) {
        ans+=dp[i][s]*vec[n-i];
    }
    cout << ans.x << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:99:11: error: expected initializer before 's'
   99 |     int n s;
      |           ^
a.cc:100:12: error: 'n' was not declared in this scope; did you mean 'yn'?
  100 |     cin >> n >> s;
      |            ^
      |            yn
a.cc:100:17: error: 's' was not declared in this scope
  100 |     cin >> n >> s;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

//hoge fuga

#define MOD 998244353LL
#define N 4096
ll p[N][N] = {{1}}, q[N][N] = {{1}};

int main(){
	int n, s; scanf("%d%d", &n, &s);
	REP(i, n){
		int a; scanf("%d", &a);
		REP(j, s+1){
			p[i+1][j] = (p[i+1][j] + p[i][j]) % MOD;
			q[i+1][j] = (q[i+1][j] + q[i][j] * 2) % MOD;
			if(j + a <= s){
				p[i+1][j+a] = (p[i+1][j+a] + p[i][j]) % MOD;
				q[i+1][j+a] = (q[i+1][j+a] + q[i][j]) % MOD;
			}
		}
	}
	printf("%lld\n", q[n][s]);
}


Compiler output:
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C++


#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 5100;
const int MOD = 998244353;

ll dp[MAX];
//

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(){
  ll N , S; cin >> N >> S;
  vector<ll> a(N); rep(i,N) cin >> a[i];

  dp[0] = 1;
  rep(i,N + 1){
    for(ll j = S - a[i]; j >= 0; j--){
      if(dp[j]) dp[j + a[i]] += 1;
    }
  }

  cout << dp[S] << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:13: error: 'cin' was not declared in this scope
   49 |   ll N , S; cin >> N >> S;
      |             ^~~
a.cc:12:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   11 | #include<bitset>
  +++ |+#include <iostream>
   12 | using namespace std;
a.cc:59:3: error: 'cout' was not declared in this scope
   59 |   cout << dp[S] << endl;
      |   ^~~~
a.cc:59:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 3005;
const int mod = 998244353;
int n, s, a[maxn], f[maxn][maxn];
int pao(int p, int q) {
    if (q == 0) return 1;
    if (q == 1) return p % mod;
    int ret = pao(p, q >> 1);
    if (q % 2) return ret * p % mod * ret % mod;
    else return ret * ret % mod;
}
signed main() {
    cin >> n >> s;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    sort(a + 1, a + n + 1);
    f[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= s; ++j)
            f[i][j] = f[i - 1][j] * 2 % mod;
            if (j + a[i] <= s) f[i][j + a[i]] = (f[i - 1][j] + f[i][j + a[i]]) % mod; 
    }
    cout << f[n][s] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'j' was not declared in this scope
   22 |             if (j + a[i] <= s) f[i][j + a[i]] = (f[i - 1][j] + f[i][j + a[i]]) % mod;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long int ll;
typedef string str;
vector<ll> nik;
bool** dp; 
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 

void printSubsetsRec(ll arr[], ll i, ll sum, vector<int>& p) 
{ 
    if (i == 0 && sum != 0 && dp[0][sum]) 
    { 
        p.pb(arr[i]); 
        nik.pb(p.size()); 
        return; 
    } 
  
    if (i == 0 && sum == 0) 
    { 
        nik.pb(p.size()); 
        return; 
    } 
  
    if (dp[i-1][sum]) 
    { 
        vector<ll> b =p;
        printSubsetsRec(arr, i-1, sum, b); 
    } 
  
    if (sum >= arr[i] && dp[i-1][sum-arr[i]]) 
    { 
        p.pb(arr[i]); 
        printSubsetsRec(arr, i-1, sum-arr[i], p); 
    } 
} 
  
// Prints all subsets of arr[0..n-1] with sum 0. 
void printAllSubsets(ll arr[], ll n, ll sum) 
{ 
    if (n == 0 || sum < 0) 
       return; 
  
    dp = new bool*[n]; 
    for (ll i=0; i<n; ++i) 
    { 
        dp[i] = new bool[sum + 1]; 
        dp[i][0] = true; 
    } 
  
    // Sum arr[0] can be achieved with single element 
    if (arr[0] <= sum) 
       dp[0][arr[0]] = true; 
  
    // Fill rest of the entries in dp[][] 
    for (ll i = 1; i < n; ++i) 
        for (ll j = 0; j < sum + 1; ++j) 
            dp[i][j] = (arr[i] <= j) ? dp[i-1][j] || 
                                       dp[i-1][j-arr[i]] 
                                     : dp[i - 1][j]; 
    if (dp[n-1][sum] == false) 
    { 
        return; 
    } 
  
    // Now recursively traverse dp[][] to find all 
    // paths from dp[n-1][sum] 
    vector<int> p; 
    printSubsetsRec(arr, n-1, sum, p); 
} 

int main ()
{
	// ios::sync_with_stdio(0);
 //    cin.tie(0);
 //    cout.tie(0);
	ll t,n,m,k,i,a,b,j;
	cin >> n >> m;
	a=998244353;
	ll arr[n+2];
	for(i=0;i<n;i++)
	{
		cin >> arr[i];
	}
	printAllSubsets(arr, n, m);
	b=0;
	for(i=0;i<nik.size();i++)
	{
		t=n-nik[i];
		b=(b+power(2,t,a))%a;
	}
	cout << b << "\n"; 
	return 0;
}

Compiler output:
a.cc: In function 'void printSubsetsRec(ll*, ll, ll, std::vector<int>&)':
a.cc:40:23: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
   40 |         vector<ll> b =p;
      |                       ^
a.cc:41:40: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
   41 |         printSubsetsRec(arr, i-1, sum, b);
      |                                        ^
a.cc:23:59: note: in passing argument 4 of 'void printSubsetsRec(ll*, ll, ll, std::vector<int>&)'
   23 | void printSubsetsRec(ll arr[], ll i, ll sum, vector<int>& p)
      |                                              ~~~~~~~~~~~~~^
Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long int;
using lc = complex<double>;

int main(void) {
    constexpr ll MOD = 998244353;
    constexpr double PI = acos(-1);
    cout << fixed << setprecision(32);
    cin.tie(0); ios::sync_with_stdio(false);


    ll n, s;
    cin >> n >> s;
    vector<int> dp(s+1);
    dp[0] = 1;
    for(ll i=1; i<=n; i++) {
        ll a;
        cin >> a;
        vector<int> pre = dp;
        for(ll j=0; j<=s; j++) {
            (dp[j] = pre[j] * 2) %= MOD;
            if(j-a[i-1]>=0)
                (dp[j] += pre[j-a]) %= MOD;
        }
    }
    cout << dp[s] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |             if(j-a[i-1]>=0)
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n,s;
    cin >> n >> s;
    vec<int> sum(n+1);
    //累積和でいける...?
    for (auto &&e : a)
    {
        cin >> e;
    }
    sort(sum.begin(),sum.end());
    for (int i = 1; i < n+1; i++)
    {
        sum.at(i) += sum.at(i-1);
    }
    long p = 998244353;
    long ans = 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'a' was not declared in this scope
   11 |     for (auto &&e : a)
      |                     ^
Language: C++

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

long long mod = 998244353;

int main() {
  
  vector<long long> n2 (3333,1);
  
  for (int i=1; i<3333; i++) {
    n2[i] = n2[i-1] * 2;
    n2[i] %= mod;
  }
  
  long long N,S;
  cin >> N >> S;
  
  vector<long long> A(N);
  
  for (int i=0; i<N; i++) {
    cin >> A[i];
  }
  
  sort(A.begin(),A.end());
  
  long long now = 0;
  long long maxx = N;
  
  for (int i=0; i<N; i++) {
    now += A[i];
    if (now > S) {
      maxx = i;
      break;
    }
  }
  
  vector<vector<long long>> dp(maxx+1,vector<long long> (S+1,0));
  
  dp[0][0] = 1;
  
  now = 0;
  
  for (int i=0; i<N; i++) {
    now += A[i];
    for (int j=min(maxx,i+1); j>0; j--) {
      for (int k=A[i]; k<S+1; k++) {
        if (k > now) {
          break;
        }
        
        dp[j][k] += dp[j-1][k-A[i]];
        dp[j][k] %= mod;
      }
    }
  }
  
  long long ans = 0;
  
  for (int i=1; i<maxx+1; i++) {
    ans += dp[i][S] * n2[N-i];
    ans %= mod;
  }
  
  cout << ans << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:19: error: no matching function for call to 'min(long long int&, int)'
   45 |     for (int j=min(maxx,i+1); j>0; 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: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:45:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   45 |     for (int j=min(maxx,i+1); j>0; j--) {
      |                ~~~^~~~~~~~~~
/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:45:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   45 |     for (int j=min(maxx,i+1); j>0; j--) {
      |                ~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#include "../Algo/NumberTheory/modulo.h"

ModuloOps MOD(998244353);

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n, s;
    cin >> n >> s;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<long long> pw2(n+1, 1);
    for (int i = 1; i <= n; i++) {
        pw2[i] = MOD.mul(pw2[i-1], 2);
    }
    auto inv2 = MOD.inv(2);

    function<long long(int, int)> dp;
    vector<vector<long long>> mem(n, vector<long long>(s+1, -1));
    dp = [&] (int i, int tot) -> long long {
        if (i < 0) {
            return tot == 0 ? pw2[n] : 0ll;
        }
        if (tot < 0) {
            return 0ll;
        }
        if (mem[i][tot] == -1) {
            long long ans = MOD.add(dp(i-1, tot), MOD.mul(inv2, dp(i-1, tot - a[i])));
            mem[i][tot] = ans;
        }
        return mem[i][tot];
    };
    cout << dp(n-1, s) << endl;
}



Compiler output:
a.cc:5:10: fatal error: ../Algo/NumberTheory/modulo.h: No such file or directory
    5 | #include "../Algo/NumberTheory/modulo.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long int;
using lc = complex<double>;

int main(void) {
    constexpr ll MOD = 998244353;
    constexpr double PI = acos(-1);
    cout << fixed << setprecision(32);
    cin.tie(0); ios::sync_with_stdio(false);


    ll n, s;
    cin >> n >> s;
    vector<ll> a(n);
    for(auto &e: a) cin >> e;
    vector<int> dp(s+1);
    dp[0][0] = 1;
    for(ll i=1; i<=n; i++)
        vector<int> pre = dp;
        for(ll j=0; j<=s; j++) {
            (dp[j] = pre[j] * 2) %= MOD;
            if(j-a[i-1]>=0)
                (dp[j] += pre[j-a[i-1]]) %= MOD;
        }
    cout << dp[n][s] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   19 |     dp[0][0] = 1;
      |          ^
a.cc:23:22: error: 'pre' was not declared in this scope; did you mean 'pread'?
   23 |             (dp[j] = pre[j] * 2) %= MOD;
      |                      ^~~
      |                      pread
a.cc:24:20: error: 'i' was not declared in this scope
   24 |             if(j-a[i-1]>=0)
      |                    ^
a.cc:27:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[ll {aka long long int}]' for array subscript
   27 |     cout << dp[n][s] << endl;
      |                  ^
Language: C++

#include <bits/stdc++.h>
#include "../lib/math/comb.hpp"
#include "../lib/math/modpow.hpp"

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 998244353;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n, s; cin >> n >> s;
  vi a(n);
  REP(i, n) {
    cin >> a[i];
  }

  Combination<MOD> comb(1000000);

  vvll dp(n+1, vll(s+1, 0));
  dp[0][0] = mod_pow<ll>(2, n, MOD);
  REP(i, n) {
    REP(j, s+1) {
      dp[i+1][j] += dp[i][j];
      dp[i+1][j] %= MOD;
      if(j+a[i] <= s) {
        dp[i+1][j+a[i]] += dp[i][j] * comb.getinv(2);
        dp[i+1][j+a[i]] %= MOD;
      }
    }
    //dp[i+1][a[i]] += mod_pow<ll>(2, n-1, MOD);
    //dp[i+1][a[i]] %= MOD;
  }

  cout << dp[n][s] << endl;
}
























Compiler output:
a.cc:2:10: fatal error: ../lib/math/comb.hpp: No such file or directory
    2 | #include "../lib/math/comb.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }

// sum, elemc
ll dp[3005][3005], dp2[3005][3005];
const ll mod = 998244353;

ll modpow(ll b, ll p, ll m) {
	ll r = 1;
	for (; p; p >>= 1, b = b * b % m) if (p & 1) r *= b;
	return r;
}

ll modinv(ll x) {
	return modpow(x, mod - 2, mod);
}

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	dp[0][0] = modpow(2, n, mod);

	ll inv2 = modinv(2);

	int n, s; read(n, s);
	rep(i, 1, n + 1) {
		read(a);
		for (int j = s; j >= a; j--) {
			dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - a[i]] * inv2 % mod) % mod;
		}
	}

	die(dp[n][s]);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:30: error: 'n' was not declared in this scope; did you mean 'yn'?
   37 |         dp[0][0] = modpow(2, n, mod);
      |                              ^
      |                              yn
a.cc:43:22: error: 'a' was not declared in this scope
   43 |                 read(a);
      |                      ^
Language: C++

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }

// sum, elemc
ll dp[3005][3005], dp2[3005][3005];
const ll mod = 998244353;

ll modpow(ll b, ll p, ll m) {
	ll r = 1;
	for (; p; p >>= 1, b = b * b % m) if (p & 1) r *= b;
	return r;
}

ll modinv(ll x) {
	return modpow(x, mod - 2, mod);

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	dp[0][0] = modpow(2, n, mod);

	ll inv2 = modinv(2);

	int n, s; read(n, s);
	rep(i, 1, n + 1) {
		read(a);
		for (int j = s; j >= a; j--) {
			dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - a[i]] * inv2 % mod) % mod;
		}
	}

	die(dp[n][s]);

}


Compiler output:
a.cc: In function 'll modinv(ll)':
a.cc:32:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   32 | int main() {
      |         ^~
a.cc:32:9: note: remove parentheses to default-initialize a variable
   32 | int main() {
      |         ^~
      |         --
a.cc:32:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:32:12: error: a function-definition is not allowed here before '{' token
   32 | int main() {
      |            ^
a.cc:50:2: error: expected '}' at end of input
   50 | }
      |  ^
a.cc:29:17: note: to match this '{'
   29 | ll modinv(ll x) {
      |                 ^
Language: C++

#include <bits/stdc++.h>
#pragma gcc optimize("Ofast", "ftree-vectorize")
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }

// sum, elemc
ll dp[3005][3005], dp2[3005][3005];
const ll mod = 998244353;

ll modpow(ll b, ll p, ll m) {
	ll r = 1;
	for (; p; p >>= 1, b = b * b % m) if (p & 1) r *= b;
	return r;
}

ll modinv(ll x) {
	return modpow(x, mod - 2, mod);

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	dp[0][0] = modpow(2, n, mod);

	ll inv2 = modinv(2);

	int n, s; read(n, s);
	rep(i, 1, n + 1) {
		read(a);
		for (int j = s; j >= a; j--) {
			dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - a[i]] * inv2 % mod) % mod;
		}
	}

	die(dp[n][s]);

}


Compiler output:
a.cc: In function 'll modinv(ll)':
a.cc:33:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   33 | int main() {
      |         ^~
a.cc:33:9: note: remove parentheses to default-initialize a variable
   33 | int main() {
      |         ^~
      |         --
a.cc:33:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:33:12: error: a function-definition is not allowed here before '{' token
   33 | int main() {
      |            ^
a.cc:51:2: error: expected '}' at end of input
   51 | }
      |  ^
a.cc:30:17: note: to match this '{'
   30 | ll modinv(ll x) {
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define N 4000
#define M 998244353
#define pii pair<ll,ll>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
ll dp[N][N][2];
int n,s;
int a[N];
ll run(int idx,int now,int al)
{
    if(dp[idx][now][al]!=-1)
        return dp[idx][now][al];
   // cout<<idx<<' '<<now<<' '<<al<<endl;
    if(idx==n)
    {
        return now==s;
    }

    ll ans=0;
    if(al==0)
    {
        ans=2*run(idx+1,now,0);
        ans%=m;
        if(a[idx]+now<=s)
        {
            ans+=run(idx+1,a[idx]+now,1);
        }
        ans%=M;
    }
    else
    {
        ans=2*run(idx+1,now,1);
        ans%=M;
        if(now+a[idx]<=s)
            ans+=run(idx+1,now+a[idx],1);
        ans%=M;
    }
    return dp[idx][now][al]=ans;
}

main()
{
    memset(dp,-1,sizeof dp);
    cin>>n>>s;
    for(int i=0;i<n;i++)
        cin>>a[i];
    cout<<run(0,0,0)<<endl;;
   // cout<<run(2,0,0);
}


Compiler output:
a.cc: In function 'long long int run(int, int, int)':
a.cc:25:14: error: 'm' was not declared in this scope; did you mean 'tm'?
   25 |         ans%=m;
      |              ^
      |              tm
a.cc: At global scope:
a.cc:43:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   43 | main()
      | ^~~~