Buggy python submission (verdict: Time Limit Exceeded):
def main():
	import sys
	sys.setrecursionlimit(10**7)
	mod=998244353
	n,s=map(int,input().split())
	a=list(map(int,input().split()))
	from functools import lru_cache
	@lru_cache(maxsize=None)
	def dfs(x,y):
		if x==0:
			if y==0:
				return 1
			else:
				return 0
		r=dfs(x-1,y)*2%mod
		if x>0:
			if y-a[x-1]>=0:
				r+=dfs(x-1,y-a[x-1])
		r%=mod
		return r
	print(dfs(n,s))
main()

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

Buggy python submission (verdict: Runtime Error):
def main():
	import sys
	sys.setrecursionlimit=10**7
	mod=998244353
	n,s=map(int,input().split())
	a=list(map(int,input().split()))
	from functools import lru_cache
	@lru_cache(maxsize=None)
	def dfs(x,y):
		if x==0:
			if y==0:
				return 1
			else:
				return 0
		r=dfs(x-1,y)*2%mod
		if y>0:
			if y-a[x-1]>=0:
				r+=dfs(x-1,y-a[x-1])
		r%=mod
		return r
	print(dfs(n,s))
main()

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

Buggy python submission (verdict: Runtime Error):
def main():
	import sys
	sys.setrecursionlimit=10**6
	mod=998244353
	n,s=map(int,input().split())
	a=list(map(int,input().split()))
	from functools import lru_cache
	@lru_cache(maxsize=None)
	def dfs(x,y):
		if x==0:
			if y==0:
				return 1
			else:
				return 0
		r=dfs(x-1,y)*2%mod
		if y>0:
			if y-a[x-1]>=0:
				r+=dfs(x-1,y-a[x-1])
		r%=mod
		return r
	print(dfs(n,s))
main()

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

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

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

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit=10**8
mod=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
ans=0
l=0
from functools import lru_cache
# @lru_cache(maxsize=None)
def dfs(x,y):
	global l
	global ans
	if y==s:
		ans+=pow(2,n-l,mod)
		ans%=mod
		return
	elif y>s or x==n:
		return
	l+=1
	dfs(x+1,y+a[x])
	l-=1
	dfs(x+1,y)
dfs(0,0)
print(ans)

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