Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;


#define ld long double
#define F first
#define S second
//
#define int long long
#define ll long long
#define db(x)                cerr<<#x<<": "<<x<<endl
#define db2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define db3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define db4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define db5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define db6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
//
#define mem(x,y) memset(x,y,sizeof(x))
#define bitcount    __builtin_popcount
//
#define pii pair<int, int>
#define all(v) v.begin(),v.end()
//
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define vi vector<int>
#define vvi vector< vector<int> >
#define si set<int>
#define pb push_back
#define lp(i,a,b) for(int i=a;i<b;i++)
#define rloop(i,a,b) for(int i=a;i>=b;i--)
#define mk make_pair
const int N=1e5+5;
const int mod=1e9+7;
const int mod1=998244353;
const int inf=1e16+7;
using namespace std;

double dp[N][N];
double pr[N];
int n;

double rec(int i,int h=0){
  //  db2(i,h);
    if(i==n){
        int  t=n-h;
        if(h>t) return  1.0;
        else return 0;
    }
    if(dp[i][h]!=0.0) return dp[i][h];
    double ans1=rec(i+1,h+1)*pr[i];
    double ans2=rec(i+1,h)*(1.0-pr[i]);
    return dp[i][h]=ans1+ans2;
    
}
void solve(){
  //  memset(dp,-1,sizeof(dp));
    
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>pr[i];
   // db("F");
    cout<<rec(0,0);
    //db("DEW");
}


int32_t main() {
    IOS;
    
    int t;
    //cin>>t;
    t=1;
    for(int i=1;i<=t;i++){
       solve();
    }
   
}

















Compiler output:
/tmp/cc9eJAau.o: in function `rec(long long, long long)':
a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc9eJAau.o
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc9eJAau.o
a.cc:(.text+0xdb): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc9eJAau.o
a.cc:(.text+0x113): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc9eJAau.o
/tmp/cc9eJAau.o: in function `solve()':
a.cc:(.text+0x194): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc9eJAau.o
a.cc:(.text+0x1c3): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc9eJAau.o
a.cc:(.text+0x1e4): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc9eJAau.o
collect2: error: ld returned 1 exit status