Tên đăng nhập Điểm ▾ Bài tập Giới thiệu
35001 0 0
35001
lethuongtrang5
Lê Xuân Lâm
0 0

Not My Githup:https://github.com/OceanGithupVN
I started learned C++ in Arpil 2023

35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0

dấd

35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0

sdsf

35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001
PY2M11
Nhap Ho Va ten
0 0
35001
PY2M13
Nhap Ho Va ten
0 0
35001
PY2M14
Nhap Ho Va ten
0 0
35001
PY2M15
Nhap Ho Va ten
0 0
35001
PY2M16
Nhap Ho Va ten
0 0
35001
PY2M17
Nhap Ho Va ten
0 0
35001
PY2M18
Nhap Ho Va ten
0 0
35001
PY2M19
Nhap Ho Va ten
0 0
35001
PY2M20
Nhap Ho Va ten
0 0
35001
PY2M21
Nhap Ho Va ten
0 0
35001
PY2M22
Nhap Ho Va ten
0 0
35001
PY2M23
Nhap Ho Va ten
0 0
35001
PY2M24
Nhap Ho Va ten
0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0
35001 0 0

n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [0] * (k+1)
dp[0] = 1
dp[1] = 1
dp[2] = 2

for i in range(3, k+1):
dp[i] = dp[i-1] + dp[i-2] + dp[i-3]

for j in range(n):
for i in range(k, a[j]-1, -1):
dp[i] -= dp[i-a[j]-1]

print(dp[k])

35001 0 0
35001 0 0
35001 0 0
35001 0 0