Language: C++

#include <bits/stdc++.h>
using namespace std;

int main {
	int n;
	cin>>n;
	vector<float> store;
	for(int i = 0 ; i < n ;i++){
		int temp;
		store.push_back(cin>>temp);
	}                                                            
	vector<vector<float> > dp(n+1 , vector<float>(n+1,0));
	dp[0][0] = 1.000000;
	for(int i = 1 ; i <=n ; i++){
		dp[0][i] = dp[0][i-1]*(1-store[i-1]); 
		dp[i][0] = dp[i-1][0]*store[i-1];
	}
	for(int i = 1 ; i <= n; i ++){
		for(int j = 1 ; j <=n && (i+j)<=n ; j++){
			dp[i][j] = dp[i][j-1]*(1-store[i-1];
			dp[i][j] += dp[i-1][j]*store[j-1];
		}
	}
	int head = n/2 +1 ;
	int tail = n - head;
	int ans = 0 ;
	while(tail!=0){
		ans+=dp[tail][head];
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main {
      |     ^~~~
a.cc:5:9: error: expected primary-expression before 'int'
    5 |         int n;
      |         ^~~
a.cc:5:9: error: expected '}' before 'int'
a.cc:4:10: note: to match this '{'
    4 | int main {
      |          ^
a.cc:6:9: error: 'cin' does not name a type
    6 |         cin>>n;
      |         ^~~
a.cc:8:9: error: expected unqualified-id before 'for'
    8 |         for(int i = 0 ; i < n ;i++){
      |         ^~~
a.cc:8:25: error: 'i' does not name a type
    8 |         for(int i = 0 ; i < n ;i++){
      |                         ^
a.cc:8:32: error: 'i' does not name a type
    8 |         for(int i = 0 ; i < n ;i++){
      |                                ^
a.cc:12:35: error: 'n' was not declared in this scope; did you mean 'yn'?
   12 |         vector<vector<float> > dp(n+1 , vector<float>(n+1,0));
      |                                   ^
      |                                   yn
a.cc:12:55: error: 'n' was not declared in this scope; did you mean 'yn'?
   12 |         vector<vector<float> > dp(n+1 , vector<float>(n+1,0));
      |                                                       ^
      |                                                       yn
a.cc:13:9: error: 'dp' does not name a type
   13 |         dp[0][0] = 1.000000;
      |         ^~
a.cc:14:9: error: expected unqualified-id before 'for'
   14 |         for(int i = 1 ; i <=n ; i++){
      |         ^~~
a.cc:14:25: error: 'i' does not name a type
   14 |         for(int i = 1 ; i <=n ; i++){
      |                         ^
a.cc:14:33: error: 'i' does not name a type
   14 |         for(int i = 1 ; i <=n ; i++){
      |                                 ^
a.cc:18:9: error: expected unqualified-id before 'for'
   18 |         for(int i = 1 ; i <= n; i ++){
      |         ^~~
a.cc:18:25: error: 'i' does not name a type
   18 |         for(int i = 1 ; i <= n; i ++){
      |                         ^
a.cc:18:33: error: 'i' does not name a type
   18 |         for(int i = 1 ; i <= n; i ++){
      |                                 ^
a.cc:24:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   24 |         int head = n/2 +1 ;
      |                    ^
      |                    yn
a.cc:25:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   25 |         int tail = n - head;
      |                    ^
      |                    yn
a.cc:27:9: error: expected unqualified-id before 'while'
   27 |         while(tail!=0){
      |         ^~~~~
a.cc:30:9: error: 'cout' does not name a type
   30 |         cout<<ans;
      |         ^~~~
a.cc:31:9: error: expected unqualified-id before 'return'
   31 |         return 0;
      |         ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^