QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 1024 MB Puntuación total: 100

#1777. 愚行致富

Estadísticas

你的朋友 Ómar 最喜欢的电子游戏是 Striker-Count。但他现在已经厌倦了玩游戏,转而对游戏里的战利品箱(lootboxes)产生了兴趣。每个战利品箱里都有一个稀有度等级的物品。Ómar 只对获取游戏中最稀有的物品感兴趣。当他开始游戏时,他会选择两个数字 $n$ 和 $k$,满足 $k \le n$。然后他会不断开启战利品箱,直到最后 $n$ 个战利品箱中包含 $k$ 个最高稀有度的物品为止。

这项活动让 Ómar 乐在其中,但你对此毫无兴趣。你更关心数字:你知道 Ómar 打开的每个战利品箱包含最高稀有度物品的概率为 $p$,且每个战利品箱之间相互独立。你想要计算 Ómar 在结束这一过程前需要开启的战利品箱的期望数量。

输入格式

输入仅一行,包含两个整数 $n$ 和 $k$ ($1 \le k \le n \le 6$),以及一个实数 $p$ ($0 < p \le 1$,且 $p$ 小数点后最多有四位),其含义如上所述。

输出格式

输出 Ómar 必须开启的战利品箱的期望数量,相对误差不超过 $10^{-6}$。

题目保证输入数据使得该期望值不超过 $10^9$。

样例

输入 1

3 2 0.0026

输出 1

74445.39143490087

输入 2

6 1 0.0026

输出 2

384.61538461538464

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.