为啥从第七个点之后就一个点都没有AC
#include<iostream>
#include<algorithm>
#include<cstring>
#include<iomanip>
#define int long long
using namespace std;
const int maxn=1000010;
double p[maxn];
double sum_b[maxn];
double sum_a[maxn];
int n;
double getsum_b(int l,int r)
{
return (sum_b[r]-sum_b[l-1]);
}
double getsum_a(int l,int r)
{
return (sum_a[r]/sum_a[l-1]);
}
signed main()
{
cin>>n;
sum_a[0]=1;
double ans=0;
for(int i=1;i<=n;i++)
{
cin>>p[i];
p[i]/=1000000;
sum_b[i]=sum_b[i-1]+(p[i]/(1-p[i]));
sum_a[i]=sum_a[i-1]*(1-p[i]);
ans=max(ans,p[i]);
}
int R=1;
for(int i=1;i<=n;i++)
{
while(R<n && getsum_b(i,R)<1) R++;
ans=max(ans,getsum_a(i,R)*getsum_b(i,R));
}
cout<<(int)(ans*1000000)<<endl;
return 0;
}