zoukankan      html  css  js  c++  java
  • zoj 3696 Alien's Organ

    /* ***********************************************
    Author        :xryz
    Email         :523689985@qq.com
    Created Time  :4-26 12:05:01
    File Name     :zoj3696.cpp
    ************************************************ */
    
    #include <stdio.h>
    #include <string.h>
    #include <iostream>
    #include <algorithm>
    #include <vector>
    #include <queue>
    #include <set>
    #include <map>
    #include <string>
    #include <math.h>
    #include <stdlib.h>
    #include <time.h>
    using namespace std;
    
    int main()
    {
        int T,i,n;
        double ans,q;
        scanf("%d",&T);
        while(T--)
        {
            scanf("%d %lf",&n,&q);
            double t=exp(-q);
            ans=t;
            for(i=1;i<=n;i++)
            {
                t*=q/i;
                ans+=t;
            }
    
            printf("%.3f
    ",ans);
        }
        return 0;
    }
    

    版权声明:本文为博主原创文章,未经博主允许不得转载。http://xiang578.top/

  • 相关阅读:
    BZOJ3403: [Usaco2009 Open]Cow Line 直线上的牛
    lintcode入门篇三
    lintcode入门篇二
    lintcode入门篇一
    matplotlib
    Pandas
    Numpy
    缓存
    Django性能优化的几种方法
    python总结十一
  • 原文地址:https://www.cnblogs.com/xryz/p/4848028.html
Copyright © 2011-2022 走看看