結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー ShirotsumeShirotsume
提出日時 2022-02-11 21:46:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 232 ms / 1,000 ms
コード長 224 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 89,212 KB
最終ジャッジ日時 2023-09-10 01:41:15
合計ジャッジ時間 5,132 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 222 ms
88,968 KB
testcase_01 AC 224 ms
88,964 KB
testcase_02 AC 225 ms
89,108 KB
testcase_03 AC 225 ms
89,008 KB
testcase_04 AC 222 ms
88,956 KB
testcase_05 AC 223 ms
89,164 KB
testcase_06 AC 225 ms
88,972 KB
testcase_07 AC 223 ms
89,108 KB
testcase_08 AC 226 ms
89,108 KB
testcase_09 AC 226 ms
89,212 KB
testcase_10 AC 228 ms
88,968 KB
testcase_11 AC 225 ms
88,976 KB
testcase_12 AC 225 ms
88,804 KB
testcase_13 AC 228 ms
88,764 KB
testcase_14 AC 232 ms
89,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int,input().split())
from fractions import Fraction

ans = max(Fraction(m, n), (1 - Fraction(m, n)) * Fraction(m, n - k - 1) + Fraction(m, n) * Fraction(m - 1, n - k - 1))

print(ans.numerator, ans.denominator)
0