問題一覧 > 通常問題

No.574 Regular Polyhedron Dice

レベル : / AI推定難易度 : 1100 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 67
作問者 : koba-e964 / テスター : はむこ
お気に入りにしたユーザー ProblemId : 1424 / 自分の提出
問題文最終更新日: 2026-06-27 21:50:23
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 174 (順位表) の他の問題:

Problem Statement

Here is a die in the shape of a regular $F$-hedron with $F$ faces. Each face has an integer from $1$ to $F$ written on it, and the integers written on any 2 different faces are different. Each face comes up with the same probability $1/F$. When this die is thrown $N$ times, what is the expected value of the $K$-th largest of the values rolled?

Input

$F$ $N$ $K$

$F=4,6,8,12,20$
$1 \le N \le 100$
$1 \le K \le N$
$N,K$ are integers.

Output

Output the expected value. Answers with a relative error of at most $10^{-6}$ are accepted. Print a newline at the end.

Sample

Sample 1
Input
4 2 1
Output
3.125

A regular tetrahedral die is thrown 2 times. There are 16 possible outcomes, $(1,1), \ldots, (4,4)$. Among them, the maximum is 4 in 7 cases, 3 in 5 cases, 2 in 3 cases, and 1 in 1 case, so the expected value is $(7 \times 4 + 5 \times 3 + 3 \times 2 + 1 \times 1) / 16 = 25/8 = 3.125$.

Sample 2
Input
6 1 1
Output
3.5

This is the expected value of a roll of an ordinary 6-sided die, so the answer is $(1+2+3+4+5+6)/6=3.5$.

Sample 3
Input
20 100 49
Output
10.797029702971770

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。