intN;        cin >> N;          vector<double> p(N);     for(inti = 0; i < N; i++)     {         cin >> p[i];     }     vector<double> p100(100);     for(inti = 0; i < 100; i++)     {         intindex = i % N;         p100[i] = p[index];     }       doublesum = 0.0;     doublepre = 1.0;     for(inti = 0; i < 50; i+=2)     {         sum += pre * p100[i];         pre *= ((1.0 - p100[i]) * (1.0 - p100[i + 1]));     }       printf("%.4f\n", sum);
点赞 5

相关推荐

无情咸鱼王的秋招日记之薛定谔的Offer:好拒信,偷了,希望有机会用到
点赞 评论 收藏
分享
牛客网
牛客企业服务