No.57 Million Dice
レベル :
/ AI推定難易度 : 79
/ 実行時間制限 : 1ケース 5.000秒 / メモリ制限
: 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-2}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : / 解いたユーザー数 753
作問者 :
nmnmnmnmnmnmnm
タグ : / 解いたユーザー数 753
作問者 :
nmnmnmnmnmnmnm
問題文最終更新日: 2026-06-25 22:01:18
English (AI translation)
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 47
(順位表)
の他の問題:
Problem Statement
There are N ordinary 6-sided dice.
Find the expected value of the sum of the numbers rolled when all of them are rolled.
Input
N
The number of dice N is given.
N is a positive integer. 1<=N<=1000000.
Output
Output the expected value on one line.
An error of up to ±0.01 is allowed.
Do not forget the newline at the end.
Sample
Sample 1
Input
1
Output
3.5
The expected value is calculated as the sum of (sum of the numbers rolled) × (probability).
Therefore, 1*1/6+2*1/6+3*1/6+4*1/6+5*1/6+6*1/6=3.5 is the answer.
Sample 2
Input
2
Output
7
2*(1/36)+3*(1/18)+4*(1/12)+5*(1/9)+6*(5/36)+7*(1/6)+8*(5/36)+9*(1/9)+10*(1/12)+11*(1/18)+12*(1/36)=7
Sample 3
Input
950832
Output
3327912
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。