博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LightOJ 1038 - Race to 1 Again (给一个数,用这个数的因数除以这个数,直到为1时,求除的次数的期望。)(概率)...
阅读量:4704 次
发布时间:2019-06-10

本文共 643 字,大约阅读时间需要 2 分钟。

题意:

题意:给一个数,用这个数的因数除以这个数,直到为1时,求除的次数的期望。

  设一个数的约数有M个,E[n] = (E[a[1]]+1)/M+(E[a[2]]+1)/M+...+(E[a[M]]+1)/M

  一个数最大的约数是它自己。

  则有,E[n] = (E[a[1]]+1)/M+(E[a[2]]+1)/M+...+(E[n]+1)/M

  (M-1)*E[n]=E[a[1]]+E[a[2]]+...+E[a[M-1]]+M

#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;#define INF 0x3f3f3f3f#define LL long long#define N 100006#define Lson rood<<1#define Rson rood<<1|1double dp[N];void Q(){ dp[1]=0; for(int i=2;i

 

转载于:https://www.cnblogs.com/a719525932/p/7803043.html

你可能感兴趣的文章
Git Stash用法
查看>>
sql server 2008学习8 sql server存储和索引结构
查看>>
Jquery radio选中
查看>>
memcached 细究(三)
查看>>
RSA System.Security.Cryptography.CryptographicException
查看>>
webservice整合spring cxf
查看>>
[解题报告] 100 - The 3n + 1 problem
查看>>
Entity Framework 学习高级篇1—改善EF代码的方法(上)
查看>>
Mybatis逆向工程配置文件详细介绍(转)
查看>>
String类的深入学习与理解
查看>>
不把DB放进容器的理由
查看>>
OnePage收集
查看>>
Java parseInt()方法
查看>>
yahoo的30条优化规则
查看>>
[CCF2015.09]题解
查看>>
[NYIST15]括号匹配(二)(区间dp)
查看>>
json_value.cpp : fatal error C1083: 无法打开编译器生成的文件:No such file or directory
查看>>
洛谷 P1101 单词方阵
查看>>
Swift DispatchQueue
查看>>
C#和JAVA 访问修饰符
查看>>