No.903 Taro's Probability
問題文最終更新日: 2019-10-11 23:03:09
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 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もしくは右上の雲マークをクリックしてアカウントを作成してください。
B0_0L