問題一覧 > 教育的問題

No.8001 This Is What Probability Theory Is Like, Right?

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

Problem Statement

For a couple with $2$ children, it is known that the probability that the $1$st child is male is $X$ and the probability that it is female is $1-X$, and furthermore that the probability that the $2$nd child is male is $Y$ and the probability that it is female is $1-Y$.
Now, under these conditions, write a program that finds the probability that the $1$st child is male and the $2$nd child is female.
Taro, who is good at math, pointed out that this may not be uniquely determined, so find the maximum and minimum values of the probability that the $1$st child is male and the $2$nd child is female.

Input

$X$ $Y$

$0 \leq X,Y \leq 1$ are given with at most $5$ digits after the decimal point.

Output

Output the maximum and minimum values of the required probability, separated by a single space.
Your answer is considered correct if the absolute error is at most $10^{-9}$.

Sample

Sample 1
Input
0.00000 0.00000
Output
0.00000000000 0.00000000000

In this world, males are simply never born, so it must be self-evident that the probability in question is absolutely $0$.

Sample 2
Input
1.00000 0.00000
Output
1.0 1.0

In this world, the $1$st child is always male and the $2$nd child is always female.
What on earth was Taro all about?

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