Buggy python submission (verdict: Time Limit Exceeded):
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
mod=998244353
d=[[0 for l in range(s+1)] for _ in range(n+1)]
d[0][0]=1
for i in range(1,n+1):
    val=a[i-1]
    for j in range(0,s+1):
        d[i][j]+=2*d[i-1][j]
        d[i][j]%=mod
        if val<=j:
            d[i][j]+=d[i-1][j-val]
            d[i][j]%=mod
print(d[n][s])

Fixed submission:
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])

Buggy python submission (verdict: Time Limit Exceeded):
n,s=map(int,input().split())
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])

Fixed submission:
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(3000)

def test(a,s,i):
    if i==len(a) or a[i]>s : return []
    if a[i]==s:return [[i]]
    else: return [[i]+x for x in test(a,s-a[i],i+1)]+test(a,s,i+1)
        

n,s=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)
l=test(a,s,0)
out=0
for s in l:
    out+=2**(len(a)-len(s))
print(out%998244353)

Fixed submission:
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])

Buggy python submission (verdict: Runtime Error):
def test(a,s,i):
    if i==len(a) or a[i]>s : return []
    if a[i]==s:return [[i]]
    else: return [[i]+x for x in test(a,s-a[i],i+1)]+test(a,s,i+1)
        

n,s=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)
l=test(a,s,0)
out=0
for s in l:
    out+=2**(len(a)-len(s))
print(out)

Fixed submission:
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])

Buggy python submission (verdict: Runtime Error):
def test(a,s,i):
    if i==len(a) or a[i]>s : return []
    if a[i]==s:return [[i]]
    else: return [[i]+x for x in test(a,s-a[i],i+1)]+test(a,s,i+1)
        

n,s=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)
print(a)
l=test(a,s,0)
print(l)
out=0
for s in l:
    out+=2**(len(a)-len(s))
print(out)

Fixed submission:
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])