問題一覧 > 通常問題

No.787 Mice and Traitors

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

Problem Statement

The mice are discussing countermeasures against a horrific incident in which many mice have been caught over the past few days.
Their investigation revealed that a traitor is hiding among the mice.
Judging from the damage, it can be concluded that "when a mouse is chosen, the probability that it is a traitor" is $P$%.
So, in order to find the traitor, the mice have decided to carry out a mass test of all the mice.
In this test, when a mouse is brought in and tested, the test outputs either that the mouse seems like a traitor or that it does not seem like a traitor.
Specifically,
・When a mouse that really is a traitor is tested, it outputs "seems like a traitor" with probability $Q$%.
・When a mouse that really is not a traitor is tested, it outputs "does not seem like a traitor" with probability $Q$%.
When the mouse Hamuko was tested, the output was, unfortunately, "seems like a traitor".
Find the probability $R$ (%) that Hamuko really is a traitor.

Input

$P$ $Q$

$P,Q$ are given on one line, separated by a space.
$P,Q$ are real numbers.
・Constraints
$0 \le P,Q \le 100$
$(P,Q) \neq (0,100) , (100,0)$ (in these cases, the test could never report a traitor in the first place)

Output

Output $R$ on one line.
A newline is required at the end of the output.
An error of up to $0.000001=10^{-6}$ is allowed.

Sample

Sample 1
Input
5 99
Output
83.8983050847458

Note that $R$ must be found in %.
This output is correctly calculated to the 13th decimal place, but in practice an error of up to $10^{-6}$ is allowed.

Sample 2
Input
0.000001 99.9
Output
0.0009989900301

Sample 3
Input
100 100
Output
100.0000000000000

In this world, betrayal is justice!!!

Hint

There are 4 types of mice, but only 2 types of mice are reported as traitors. And the proportion of those that really are traitors among them is...?

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