//Accepted    2860 KB    16 ms
 //概率
 //对于n,假设n变成1的期望步数为p(n)
 //则p(n)=1/t*sum((1+p(d))) d|n
 //解得:p(n)=1/(t-1)*(t+sum(p(d))) d|n d!=n;
 //下面我们可以改造筛素数的方法,对于每个d,看他整除那些数
 #include <cstdio>
 #include <cstring>
 #include <iostream>
 #include <queue>
 #include <cmath>
 #include <algorithm>
 using namespace std;
 /**
   * This is a documentation comment block
   * 如果有一天你坚持不下去了,就想想你为什么走到这儿!
   * @authr songt
   */
 ;
 double f[imax_n];
 int t[imax_n];
 void pre()
 {
     ;i<imax_n;i++)
     {
         f[i]=;
         t[i]=;
     }
     f[]=;
     ;i<imax_n-;i++)
     {
         f[i]=(f[i]+)/t[i];
         *i;j<imax_n-;j+=i)
         {
             f[j]+=+f[i];
             t[j]++;
         }
     }
 }
 int n;
 int main()
 {
     pre();
     int T;
     ;
     scanf("%d",&T);
     while (T--)
     {
         scanf("%d",&n);
         printf("Case %d: %.6lf\n",++t,f[n]);
     }
     ;
 }

最新文章

  1. 解决:Angular-cli:执行ng-build --prod后,dist文件里无js文件、文件未压缩等问题
  2. Hbase之缓存扫描加快读取速度
  3. AndrdoidStudio 2个jar包引起的异常Duplicate files copied in APK META-INF/LICENSE.txt
  4. System Generator入门笔记
  5. JavaScript Tutorial
  6. HW4.40
  7. MySQLD 配置
  8. applet授权数字签名
  9. NYOJ 57 6174问题
  10. 又把JDK改回JDK1.8的过程
  11. git 更新远程分支列表
  12. 【你的职业规划】web前端的职业发展方向及学习攻略【转载】
  13. Redis数据库的安装与基本应用
  14. spoj Prime Generator
  15. hdu-1173(最短距离)
  16. 谈谈hadoop集群启动时进程那回事
  17. ativemq使用教程
  18. POJ 1703 Find them, Catch them(确定元素归属集合的并查集)
  19. mysql基础操作学习笔记(一)
  20. Openstack块存储cinder安装配置

热门文章

  1. x^y=(x&amp;~y)|(~x&amp;y)证明
  2. html5重定义标签
  3. CentOS中yum安装软件时报错:No package XXX available
  4. Access中多表内联的SQL写法
  5. 在excel单元格中提取信息
  6. [Jetty] jetty 内存调优
  7. 《Java程序设计》第三周学习总结
  8. sql server多表数据批量更新
  9. (09)odoo工作流
  10. jquery iframe高度自适应