HDU 多校1.5
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
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
(1≤d≤n)
.
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
,p
2
,⋯,p
m
will be given, satisfying n
has m
distinct prime factors exactly.
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 2≤n≤1024
.
The second lines contains m
distinct prime numbers p1
,p
2
,⋯,p
m
, satisfying 2≤pi
≤10
6
.
About 2⋅105
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.
: y
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 10−9
.
2
4 1
2
6 2
2 3
8 1
2
10 2
2 5
12 2
2 3
Case #2: 2.5000000000
Case #3: 2.6666666667
Case #4: 2.8333333333
Case #5: 2.6666666667
Case #6: 3.0333333333
HDU 多校1.5的更多相关文章
- 2018 HDU多校第四场赛后补题
2018 HDU多校第四场赛后补题 自己学校出的毒瘤场..吃枣药丸 hdu中的题号是6332 - 6343. K. Expression in Memories 题意: 判断一个简化版的算术表达式是否 ...
- 2018 HDU多校第三场赛后补题
2018 HDU多校第三场赛后补题 从易到难来写吧,其中题意有些直接摘了Claris的,数据范围是就不标了. 如果需要可以去hdu题库里找.题号是6319 - 6331. L. Visual Cube ...
- 2015 HDU 多校联赛 5363 Key Set
2015 HDU 多校联赛 5363 Key Set 题目: http://acm.hdu.edu.cn/showproblem.php? pid=5363 依据前面给出的样例,得出求解公式 fn = ...
- 2015 HDU 多校联赛 5317 RGCDQ 筛法求解
2015 HDU 多校联赛 5317 RGCDQ 筛法求解 题目 http://acm.hdu.edu.cn/showproblem.php? pid=5317 本题的数据量非常大,測试样例多.数据 ...
- [HDU多校]Ridiculous Netizens
[HDU多校]Ridiculous Netizens 点分治 分成两个部分:对某一点P,连通块经过P或不经过P. 经过P采用树形依赖背包 不经过P的部分递归计算 树型依赖背包 v点必须由其父亲u点转移 ...
- 【杂题总汇】HDU多校赛第十场 Videos
[HDU2018多校赛第十场]Videos 最后一场比赛也结束了…… +HDU传送门+ ◇ 题目 <简要翻译> 有n个人以及m部电影,每个人都有一个快乐值.每场电影都有它的开始.结束时间和 ...
- hdu多校1002 Balanced Sequence
Balanced Sequence Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s) ...
- HDU多校(Distinct Values)
Problem Description Chiaki has an array of n positive integers. You are told some facts about the ar ...
- hdu多校6
这个场要恶心死我了.. 1001 积分题,不要四舍五入 //#pragma comment(linker, "/stack:200000000") //#pragma GCC op ...
- hdu 多校第一场
1001 思路:打表可以发现只有3|n 和 4|n 的情况有解,判一下就好啦. #include<bits/stdc++.h> #define LL long long #define f ...
随机推荐
- WebSocket简单介绍(WebSocket 实战)(3)
这一节里我们用一个案例来演示怎么使用 WebSocket 构建一个实时的 Web 应用.这是一个简单的实时多人聊天系统,包括客户端和服务端的实现.客户端通过浏览器向聊天服务器发起请求,服务器端解析客户 ...
- Hibernate技术入门
ORM原理 ORM(Object Relational Mapping)是对象到关系的映射,它的作用是在关系数据库和对象之间做一个自动映射,将数据库中的数据表映射成对象(持久化类),对关系型数据库以对 ...
- Visio中的Undo和Redo
1.Visio默认Undo和Redo操作是可用的,Appliacation中的UndoEnabled标志Undo和Redo操作是否可用. m_Visio.Window.Application.Undo ...
- [Leetcode] Longest consecutive sequence 最长连续序列
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. F ...
- 【17.12.22.B】
B 题面描述: 给一个长度为n的序列,a[1], a[2], ... , a[n], 选出连续的k个数,使得这k个数的最大值加这k个数的or值最大. 假设选出的数为a[l], a[l + 1], .. ...
- Ubuntu下使用find / -name aaa* 提示“find: 路径必须在表达式之前: XXXX”
在使用find命令查找文件时,出现了如题所示的错误提示,因为之前都是这样用的,也没出过错,这次语法都是一样的居然不行了,很是纳闷. 后来了解到如下的情况: 如果当前所在目录存在要查找的目标文件时会出现 ...
- Unescape JavaScript's escape() using C#
js里面的 unescape escape 对应C#里面 var unescapedString = Microsoft.JScript.GlobalObject.unescape(yourEscap ...
- OSI 七层模型和 TCP/IP 四层模型 及 相关网络协议
简介 OSI 是理论上的模型,也就是一个统一的国际标准,现在的很多网络设备或者是网络协议都不同程度的精简了自己的所谓的模型,那么他们为了自己的通讯兼容都会参考这个OSI模型 TCP/IP 包括: TC ...
- node搭建文件服务器
python可以在目录下python -m http.server 8080来启动一个静态文件服务器,使用node实现一个 运行node fileServer.js D:\lanFeature 即可将 ...
- C# 序列化理解 2(转)
一.概述 序列化是把对象转变成流.相反的过程就是反序列化. 哪些场合用到这项技术呢? 1. 把对象保存到本地,下次运行程序时恢复这个对象. 2. 把对象传送到网络的另一台终端上,然后在此终端还原这个对 ...