Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [float(x) for x in input().strip().split()]
dp = [[None for i in range(n//2+2)] for j in range(n)]
for i in range(n):
    dp[i][0] =1

for j in range(n//2+2):
    dp[n-1][j] = 0
dp[n-1][0] = 1
dp[n-1][1] = p[n-1]

for i in range(n-2,-1,-1):
    for j in range(1,n//2+2):
        dp[i][j] = p[i]*dp[i+1][j-1]+(1-p[i])*dp[i+1][j]

print(dp[0][-1])



Fixed submission:
n = int(input())
p = [float(x) for x in input().strip().split()]
dp = [[None for i in range(n//2+2)] for j in range(n)]
for i in range(n):
    dp[i][0] =1

for j in range(n//2+2):
    dp[n-1][j] = 0
dp[n-1][0] = 1
dp[n-1][1] = p[n-1]

for i in range(n-2,-1,-1):
    for j in range(1,n//2+2):
        dp[i][j] = p[i]*dp[i+1][j-1]+(1-p[i])*dp[i+1][j]

print(dp[0][-1])

"""
Recursive top down

# def solve(i,k):
#     # print(i,k)
#     if i<=n-1 and k>0 and dp[i][k]:
#         return dp[i][k]
#     if k<=0:
#         # if i not in dp:
#         #     dp[i] ={}
#         # dp[i][k] = 1
#         return 1

#     elif i>n-1:
#         # if i not in dp:
#         #     dp[i] ={}
#         # dp[i][k] = 0
#         return 0
#     elif k>n-i:
#         # if i not in dp:
#         #     dp[i] ={}
#         dp[i][k] = 0

#     else:
#         # if i not in dp:
#         #     dp[i] ={}
#         dp[i][k] = p[i]*solve(i+1,k-1)+(1-p[i])*solve(i+1,k)
#     return dp[i][k]


# print(solve(0,n//2+1))


"""

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [float(x) for x in input().strip().split()]
dp = [[None for i in range(n//2+2)] for j in range(n)]
# for i in range(n):
#     dp[i][0] =0
def solve(i,k):
    # print(i,k)
    if i<=n-1 and k>0 and dp[i][k]:
        return dp[i][k]
    if k<=0:
        # if i not in dp:
        #     dp[i] ={}
        # dp[i][k] = 1
        return 1

    elif i>n-1:
        # if i not in dp:
        #     dp[i] ={}
        # dp[i][k] = 0
        return 0
    elif k>n-i:
        # if i not in dp:
        #     dp[i] ={}
        dp[i][k] = 0

    else:
        # if i not in dp:
        #     dp[i] ={}
        dp[i][k] = p[i]*solve(i+1,k-1)+(1-p[i])*solve(i+1,k)
    return dp[i][k]

print(solve(0,n//2+1))

Fixed submission:
n = int(input())
p = [float(x) for x in input().strip().split()]
dp = [[None for i in range(n//2+2)] for j in range(n)]
for i in range(n):
    dp[i][0] =1

for j in range(n//2+2):
    dp[n-1][j] = 0
dp[n-1][0] = 1
dp[n-1][1] = p[n-1]

for i in range(n-2,-1,-1):
    for j in range(1,n//2+2):
        dp[i][j] = p[i]*dp[i+1][j-1]+(1-p[i])*dp[i+1][j]

print(dp[0][-1])

"""
Recursive top down

# def solve(i,k):
#     # print(i,k)
#     if i<=n-1 and k>0 and dp[i][k]:
#         return dp[i][k]
#     if k<=0:
#         # if i not in dp:
#         #     dp[i] ={}
#         # dp[i][k] = 1
#         return 1

#     elif i>n-1:
#         # if i not in dp:
#         #     dp[i] ={}
#         # dp[i][k] = 0
#         return 0
#     elif k>n-i:
#         # if i not in dp:
#         #     dp[i] ={}
#         dp[i][k] = 0

#     else:
#         # if i not in dp:
#         #     dp[i] ={}
#         dp[i][k] = p[i]*solve(i+1,k-1)+(1-p[i])*solve(i+1,k)
#     return dp[i][k]


# print(solve(0,n//2+1))


"""

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [float(x) for x in input().strip().split()]
dp = {}
def solve(i,k):
    if i in dp and k in dp[i]:
        return dp[i][k]
    if k<=0:
        if i not in dp:
            dp[i] ={}
        dp[i][k] = 1
    elif k>n-i:
        if i not in dp:
            dp[i] ={}
        dp[i][k] = 0
    elif i>n-1:
        if i not in dp:
            dp[i] ={}
        dp[i][k] = 0
    else:
        if i not in dp:
            dp[i] ={}
        dp[i][k] = p[i]*solve(i+1,k-1)+(1-p[i])*solve(i+1,k)
    return dp[i][k]

print(solve(0,n//2+1))

Fixed submission:
n = int(input())
p = [float(x) for x in input().strip().split()]
dp = [[None for i in range(n//2+2)] for j in range(n)]
for i in range(n):
    dp[i][0] =1

for j in range(n//2+2):
    dp[n-1][j] = 0
dp[n-1][0] = 1
dp[n-1][1] = p[n-1]

for i in range(n-2,-1,-1):
    for j in range(1,n//2+2):
        dp[i][j] = p[i]*dp[i+1][j-1]+(1-p[i])*dp[i+1][j]

print(dp[0][-1])

"""
Recursive top down

# def solve(i,k):
#     # print(i,k)
#     if i<=n-1 and k>0 and dp[i][k]:
#         return dp[i][k]
#     if k<=0:
#         # if i not in dp:
#         #     dp[i] ={}
#         # dp[i][k] = 1
#         return 1

#     elif i>n-1:
#         # if i not in dp:
#         #     dp[i] ={}
#         # dp[i][k] = 0
#         return 0
#     elif k>n-i:
#         # if i not in dp:
#         #     dp[i] ={}
#         dp[i][k] = 0

#     else:
#         # if i not in dp:
#         #     dp[i] ={}
#         dp[i][k] = p[i]*solve(i+1,k-1)+(1-p[i])*solve(i+1,k)
#     return dp[i][k]


# print(solve(0,n//2+1))


"""