問題一覧 > 通常問題

No.903 Taro's Probability

レベル : / AI推定難易度 : 77 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $5 \times 10^{-4}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 505
作問者 : B0_0L / テスター : yuki2006
お気に入りにしたユーザー ProblemId : 3413 / 自分の提出
問題文最終更新日: 2019-10-11 23:03:09
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 227 (順位表) の他の問題:

Problem Statement

Taro is now playing the Game of Life. He is just 1 square away from the goal!
He wants to know the probability that the die he is about to roll shows a 1, letting him reach the goal.
This die has the numbers from 1 up to N in order.
Now, you just happened to be passing by!
Please tell Taro the probability that a 1 comes up.

Assume that every face of the die is equally likely to come up.

Input

$N$

$1\le N \le 100$

Output

Taro does not understand fractions, so please answer in decimal form.
Some error is allowed.

Sample

Sample 1
Input
10
Output
0.100000

The probability that a 10-sided die shows a 1 is 0.1

Sample 2
Input
6
Output
0.166667

A 6-sided die shows a 1 approximately 15% of the time.

Sample 3
Input
1
Output
1.000000

If there is only one face, a 1 always comes up.

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