正文
增加 4 行删除 4 行
72 行未改动73747576777879808182838485868 行未改动72 行未改动//freopen(".in","r",stdin);//freopen(".out","w",stdout);n=read();for(register int i=1;i<=n;i++)p[i]=read(),p[i]/=1e6,ans=max(ans,p[i]);//L左端点,R右端点for(register int L=1;L<=n;L++){while(R<n&&B<1){R++;B+=p[R]/(1-p[R]);A*=(1-p[R]);}//单调性ans=max(ans,A*B);//统计答案A/=(1-p[L]);B-=p[L]/(1-p[L]);//把L变成L+1}printf("%d\n",int(ans*1e6));return 0;}8 行未改动72 行未改动73747576777879808182838485868 行未改动72 行未改动//freopen(".in","r",stdin);//freopen(".out","w",stdout);n=read();for(register int i=1;i<=n;i++)p[i]=read(),p[i]/=1e6,ans=max(ans,p[i]);//L左端点,R右端点for(register int L=1;L<=n;L++){while(R<n&&B<1){R++;B+=p[R]/(1-p[R]);A*=(1-p[R]);}//单调性ans=max(ans,A*B);//统计答案A/=(1-p[L]);B-=p[L]/(1-p[L]);//把L变成L+1}printf("%d\n",int(ans*1e6));return 0;}8 行未改动