博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU 多校1.5
阅读量:4949 次
发布时间:2019-06-11

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

Expectation Division

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)

Total Submission(s): 0    Accepted Submission(s): 0
Special Judge

Problem Description
To be frank with you, this problem is a classic problem of tremendous magnitude which may increase the difficulty of this problem.
We define a type of operation concerning a positive integer
n (n>1) as to replace it with an integer d , one of factors of n (1dn) .
You are given a positive integer n and then we will ask you to determine the expectation number of times to utilize this type of operation if we want to change n into 1 by operating again and again, assuming each possible d in each operation has equal possibility to select.
For the sake of calculation, n and all its distinct prime factors p1,p2,,pm will be given, satisfying n has m distinct prime factors exactly.
 

 

Input
The input contains multiple test cases.
For each test case:
The first line contains two positive integers
n and m which indicates m is the number of distinct prime factors of n , satisfying 2n1024 .
The second lines contains m distinct prime numbers p1,p2,,pm , satisfying 2pi106 .
About 2105 test cases in total.
Warm Tips for C/C++: __int128_t is available here but standard solutions of this problem do not use this compiler-dependent data type.
 

 

Output
For each test case, output "
Case #x : y " in one line (without quotes), where
x indicates the case number starting from 1 and y denotes the expectation number of times to utilize this type of operation of corresponding case. Your answer will be considered correct if its absolute or relative error won't exceed 109 .
 

 

Sample Input
2 1 2 4 1 2 6 2 2 3 8 1 2 10 2 2 5 12 2 2 3
 

 

Sample Output
Case #1: 2.0000000000 Case #2: 2.5000000000 Case #3: 2.6666666667 Case #4: 2.8333333333 Case #5: 2.6666666667 Case #6: 3.0333333333

转载于:https://www.cnblogs.com/Roni-i/p/7233428.html

你可能感兴趣的文章
C# abstract,virtual 修饰符
查看>>
java.lang.NoClassDefFoundError: org/hibernate/validator/internal/engine/DefaultClockProvider
查看>>
修改Android签名证书keystore的密码、别名alias以及别名密码
查看>>
整理基础的CentOS常用命令
查看>>
hello world
查看>>
【CentOS 6.5】 Qt Creator 启动失败
查看>>
第五章:标准I/O库
查看>>
webservice 协议
查看>>
Delphi中TApplication详解(转仅供自己参考)
查看>>
Locality Sensitive Hashing,LSH
查看>>
cookie and session
查看>>
shell脚本调试运行
查看>>
ios 同步Get请求的实现
查看>>
CSS中背景图片定位方法
查看>>
Android apk 的Zipalign优化
查看>>
springmvc----demo3---rest风格---bai
查看>>
现代软件工程_团队项目_阿尔法阶段_第五次会议记录_2017.11.27
查看>>
Cadence Allegro 如何关闭铺铜(覆铜)shape的显示和设置shape显示模式–allegro小技巧...
查看>>
IOS 透视投影矩阵推导(转)
查看>>
ios检查版本更新
查看>>