Buggy python submission (verdict: Time Limit Exceeded):
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])


Fixed submission:
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])

Buggy python submission (verdict: Runtime Error):
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])
z

Fixed submission:
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
def main():
    n,s=map(int,input().split())
    MOD=998244353
    import numpy as np
    A=list(map(int,input().split()))
    dp=[np.array([0]*(n+1)) for _ in range(s)]
    dp=[np.array([1]+[0]*n)]+dp 
    for i in range(n):
        u=A[i]
        for j in range(s,-1,-1):
            if j+u<=s:
                dp[j+u][1:]+=dp[j][:-1]
                dp[j+u]%=MOD
    #print(dp)

    w=dp[s]
    q=[2**(n-i) for i in range(n+1)]
    ans=w*q%MOD
    print(ans.sum()%MOD)
#print(w)

main()

Fixed submission:
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
def main():
    n,s=map(int,input().split())
    MOD=998244353
    import numpy as np
    A=list(map(int,input().split()))
    dp=[np.array([0]*(n+1)) for _ in range(s)]
    dp=[np.array([1]+[0]*n)]+dp 
    for i in range(n):
        u=A[i]
        for j in range(s,-1,-1):
            if j+u<=s:
                dp[j+u][1:]+=dp[j][:-1]
                dp[j+u]%=MOD
    #print(dp)

    w=dp[s]
    q=[2**(n-i) for i in range(n+1)]
    ans=w*q%MOD
    print(ans.sum()%MOD)
#print(w)
if __name__=="__main__":
    main()


Fixed submission:
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])

Buggy python submission (verdict: Time Limit Exceeded):
n,s=map(int,input().split())
MOD=998244353
import numpy as np
A=list(map(int,input().split()))
dp=[np.array([0]*(n+1)) for _ in range(s)]
dp=[np.array([1]+[0]*n)]+dp 
for i in range(n):
    u=A[i]
    for j in range(s,-1,-1):
        if j+u<=s:
            dp[j+u][1:]+=dp[j][:-1]
            dp[j+u]%=MOD
    #print(dp)

w=dp[s]
q=[2**(n-i) for i in range(n+1)]
ans=w*q%MOD
print(ans.sum()%MOD)
#print(w)

Fixed submission:
mod = 998244353
N, S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[0 for i in range(S+1)] for j in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += dp[i][j] * 2
        if j + A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j]
        dp[i+1][j] %= mod

print(dp[N][S])