問題一覧 > 通常問題

No.242 Bingo Game

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

Problem Statement

We play a bingo game using a card with a grid of $5\times5$ squares.
The $25$ squares of the card contain $25$ of the numbers from $1$ to $99$, written without duplicates.
When $5$ numbers line up in $1$ line, either vertically, horizontally, or diagonally, it counts as $1$ bingo.

A-kun has been handed a bingo card with randomly written numbers.
From now on, $N$ of the numbers from $1$ to $99$ will be called out randomly without duplicates.
What is the expected number of bingos formed after the $N$ numbers have been called out?

Input

$N$

The number $N$ of numbers to be called out is given. $N$ is an integer. $1 \le N \le 99$.

Output

Output the expected number of bingos formed on $1$ line.
The allowed error is $1e-06$.
Do not forget the newline at the end.

Sample

Sample 1
Input
4
Output
0

If only $4$ numbers are called out, not even $1$ bingo can be formed.

Sample 2
Input
62
Output
1.0856908639251

When $62$ numbers are called out, the expected value finally exceeds $1$.

Sample 3
Input
99
Output
12

If all the numbers are called out, all the vertical, horizontal, and diagonal lines should be bingos.

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