Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mst(a, b) memset((a), (b), sizeof(a))
#define mp(a, b) make_pair(a, b)
#define pi acos(-1)
#define pii pair<int, int>
#define pb push_back
const int INF = 0x3f3f3f3f;
const double eps = 1e-10;
const int maxn = 3e3 + 7;
const int maxm = 5e5 + 10;
double s[maxn];
double dp[maxn][maxn];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> s[i];
    dp[1][1] = s[1];
    dp[1][0] = 1.0 - s[1];
    for (int i = 2; i <= n; ++i)
    {
        for (int j = 0; j <= n; ++j)
        {
            if (j == 0)
                dp[i][j] = dp[i - 1][j] * (1.0 - s[i]);
            else
                dp[i][j] = dp[i - 1][j - 1] * s[i] + dp[i - 1][j] * (1.0 - s[i]);
        }
    }
    double ans = 0.00;
    for (int i = (n + 1) / 2; i <= n; ++i)
        ans += dp[n][i];
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mst(a, b) memset((a), (b), sizeof(a))
#define mp(a, b) make_pair(a, b)
#define pi acos(-1)
#define pii pair<int, int>
#define pb push_back
const int INF = 0x3f3f3f3f;
const double eps = 1e-10;
const int maxn = 3e3 + 7;
const int maxm = 5e5 + 10;
double s[maxn];
double dp[maxn][maxn];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> s[i];
    dp[1][1] = s[1];
    dp[1][0] = 1.0 - s[1];
    for (int i = 2; i <= n; ++i)
    {
        for (int j = 0; j <= n; ++j)
        {
            if (j == 0)
                dp[i][j] = dp[i - 1][j] * (1.0 - s[i]);
            else
                dp[i][j] = dp[i - 1][j - 1] * s[i] + dp[i - 1][j] * (1.0 - s[i]);
        }
    }
    double ans = 0.00;
    for (int i = (n + 1) / 2; i <= n; ++i)
        ans += dp[n][i];
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}

Compiler output:
a.cc:42:2: error: stray '#' in program
   42 | }#include <bits/stdc++.h>
      |  ^
a.cc:42:3: error: 'include' does not name a type
   42 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:51:11: error: redefinition of 'const int INF'
   51 | const int INF = 0x3f3f3f3f;
      |           ^~~
a.cc:10:11: note: 'const int INF' previously defined here
   10 | const int INF = 0x3f3f3f3f;
      |           ^~~
a.cc:52:14: error: redefinition of 'const double eps'
   52 | const double eps = 1e-10;
      |              ^~~
a.cc:11:14: note: 'const double eps' previously defined here
   11 | const double eps = 1e-10;
      |              ^~~
a.cc:53:11: error: redefinition of 'const int maxn'
   53 | const int maxn = 3e3 + 7;
      |           ^~~~
a.cc:12:11: note: 'const int maxn' previously defined here
   12 | const int maxn = 3e3 + 7;
      |           ^~~~
a.cc:54:11: error: redefinition of 'const int maxm'
   54 | const int maxm = 5e5 + 10;
      |           ^~~~
a.cc:13:11: note: 'const int maxm' previously defined here
   13 | const int maxm = 5e5 + 10;
      |           ^~~~
a.cc:55:8: error: redefinition of 'double s [3007]'
   55 | double s[maxn];
      |        ^
a.cc:14:8: note: 'double s [3007]' previously declared here
   14 | double s[maxn];
      |        ^
a.cc:56:8: error: redefinition of 'double dp [3007][3007]'
   56 | double dp[maxn][maxn];
      |        ^~
a.cc:15:8: note: 'double dp [3007][3007]' previously declared here
   15 | double dp[maxn][maxn];
      |        ^~
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main()
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main()
      |     ^~~~