Language: C++

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <cstring>
#include <iomanip>
#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1000000000
typedef long long  ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

template<typename T>
T gcd(T a,T b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a /g* b ;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
template<typename T>
int  GetDigit(T num){
    int digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

template<typename T>
std::vector<T> enum_div(T n)//nの約数を列挙
{
	std::vector<T> ret;
	for(T i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}


class DisjointSet{
    public:
        vector<int> rank, p;

        DisjointSet(){
        }

        DisjointSet(int size){
            rank.resize(size, 0);
            p.resize(size, 0);
            for (int i = 0; i < size;i++){
                makeSet(i);
            }
        }
        void makeSet(int x){
            p[x] = x;
            rank[x] = 0;
        }

        bool same(int x,int y){
            return findSet(x) == findSet(y);
        }
        void unite(int x,int y){
            link(findSet(x), findSet(y));
        }
        void link(int x,int y){
            if(rank[x]>rank[y]){
                p[y] = x;
            }else{
                p[x] = y;
                if(rank[x]==rank[y]){
                    rank[y]++;
                }
            }
        }
        int findSet(int x){
            if(x!=p[x]){
                p[x] = findSet(p[x]);
            }
            return p[x];
        }
};


int main()
{
    int N;
    cin >> N;
    double p[N];
    REP(i,0,N){
        cin >> p[i];
    }
    double dp[N+1][N+1];

    REP(i,0,N+1){
        REP(j,0,N+1){
            dp[i][j] = 0.0;
        }
    }
    dp[0][0] = 1.0;
    REP(i,0,N){
        REP(j,0,N+1){
            if(j==0){
                dp[i + 1][j] = dp[i][j] * (1.0-p[i]);
            }else if(j==N){
                dp[i + 1][j] = dp[i][j - 1] * p[i];
            }else{
                dp[i + 1][j] = dp[i][j - 1] * p[i]+dp[i][j] * (1.0-p[i]);
            }
            
        }
    }

    double ans = 0.0;
    REP(j,1,N+1){
        if(j>N-j){
            ans += dp[N][j];
        }
    }

    cout << fixed;
    cout << setprecision(10) << ans << endl;
}#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <cstring>
#include <iomanip>
#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1000000000
typedef long long  ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

template<typename T>
T gcd(T a,T b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a /g* b ;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
template<typename T>
int  GetDigit(T num){
    int digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

template<typename T>
std::vector<T> enum_div(T n)//nの約数を列挙
{
	std::vector<T> ret;
	for(T i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}


class DisjointSet{
    public:
        vector<int> rank, p;

        DisjointSet(){
        }

        DisjointSet(int size){
            rank.resize(size, 0);
            p.resize(size, 0);
            for (int i = 0; i < size;i++){
                makeSet(i);
            }
        }
        void makeSet(int x){
            p[x] = x;
            rank[x] = 0;
        }

        bool same(int x,int y){
            return findSet(x) == findSet(y);
        }
        void unite(int x,int y){
            link(findSet(x), findSet(y));
        }
        void link(int x,int y){
            if(rank[x]>rank[y]){
                p[y] = x;
            }else{
                p[x] = y;
                if(rank[x]==rank[y]){
                    rank[y]++;
                }
            }
        }
        int findSet(int x){
            if(x!=p[x]){
                p[x] = findSet(p[x]);
            }
            return p[x];
        }
};


int main()
{
    int N;
    cin >> N;
    double p[N];
    REP(i,0,N){
        cin >> p[i];
    }
    double dp[N+1][N+1];

    REP(i,0,N+1){
        REP(j,0,N+1){
            dp[i][j] = 0.0;
        }
    }
    dp[0][0] = 1.0;
    REP(i,0,N){
        REP(j,0,N+1){
            if(j==0){
                dp[i + 1][j] = dp[i][j] * (1.0-p[i]);
            }else if(j==N){
                dp[i + 1][j] = dp[i][j - 1] * p[i];
            }else{
                dp[i + 1][j] = dp[i][j - 1] * p[i]+dp[i][j] * (1.0-p[i]);
            }
            
        }
    }

    double ans = 0.0;
    REP(j,1,N+1){
        if(j>N-j){
            ans += dp[N][j];
        }
    }

    cout << fixed;
    cout << setprecision(10) << ans << endl;
}

Compiler output:
a.cc:182:2: error: stray '#' in program
  182 | }#include <iostream>
      |  ^
a.cc:182:3: error: 'include' does not name a type
  182 | }#include <iostream>
      |   ^~~~~~~
a.cc:202:5: error: redefinition of 'template<class T> int vector_finder(std::vector<_Tp>, T)'
  202 | int vector_finder(std::vector<T> vec, T number) {
      |     ^~~~~~~~~~~~~
a.cc:21:5: note: 'template<class T> int vector_finder(std::vector<_Tp>, T)' previously declared here
   21 | int vector_finder(std::vector<T> vec, T number) {
      |     ^~~~~~~~~~~~~
a.cc:214:3: error: redefinition of 'template<class T> T gcd(T, T)'
  214 | T gcd(T a,T b){
      |   ^~~
a.cc:33:3: note: 'template<class T> T gcd(T, T)' previously declared here
   33 | T gcd(T a,T b){
      |   ^~~
a.cc:223:3: error: redefinition of 'template<class T> T lcm(T, T)'
  223 | T lcm(T a,T b){
      |   ^~~
a.cc:42:3: note: 'template<class T> T lcm(T, T)' previously declared here
   42 | T lcm(T a,T b){
      |   ^~~
a.cc:228:6: error: redefinition of 'void clear(std::queue<std::pair<int, int> >&)'
  228 | void clear( std::queue<pair<int,int> > &q )
      |      ^~~~~
a.cc:47:6: note: 'void clear(std::queue<std::pair<int, int> >&)' previously defined here
   47 | void clear( std::queue<pair<int,int> > &q )
      |      ^~~~~
a.cc:233:6: error: redefinition of 'bool IsPrime(int)'
  233 | bool IsPrime(int num)
      |      ^~~~~~~
a.cc:52:6: note: 'bool IsPrime(int)' previously defined here
   52 | bool IsPrime(int num)
      |      ^~~~~~~
a.cc:253:6: error: redefinition of 'template<class T> int GetDigit(T)'
  253 | int  GetDigit(T num){
      |      ^~~~~~~~
a.cc:72:6: note: 'template<class T> int GetDigit(T)' previously declared here
   72 | int  GetDigit(T num){
      |      ^~~~~~~~
a.cc:263:16: error: redefinition of 'template<class T> std::vector<_Tp> enum_div(T)'
  263 | std::vector<T> enum_div(T n)//nの約数を列挙
      |                ^~~~~~~~
a.cc:82:16: note: 'template<class T> std::vector<_Tp> enum_div(T)' previously declared here
   82 | std::vector<T> enum_div(T n)//nの約数を列挙
      |                ^~~~~~~~
a.cc:281:7: error: redefinition of 'class DisjointSet'
  281 | class DisjointSet{
      |       ^~~~~~~~~~~
a.cc:100:7: note: previous definition of 'class DisjointSet'
  100 | class DisjointSet{
      |       ^~~~~~~~~~~
a.cc:325:5: error: redefinition of 'int main()'
  325 | int main()
      |     ^~~~
a.cc:144:5: note: 'int main()' previously defined here
  144 | int main()
      |     ^~~~