結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー shotoyooshotoyoo
提出日時 2022-02-11 21:29:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 238 ms / 1,000 ms
コード長 508 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 89,728 KB
最終ジャッジ日時 2023-09-10 00:54:37
合計ジャッジ時間 5,428 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 234 ms
89,644 KB
testcase_01 AC 234 ms
89,316 KB
testcase_02 AC 235 ms
89,452 KB
testcase_03 AC 233 ms
89,684 KB
testcase_04 AC 236 ms
89,708 KB
testcase_05 AC 234 ms
89,404 KB
testcase_06 AC 234 ms
89,660 KB
testcase_07 AC 231 ms
89,568 KB
testcase_08 AC 233 ms
89,596 KB
testcase_09 AC 234 ms
89,644 KB
testcase_10 AC 233 ms
89,564 KB
testcase_11 AC 235 ms
89,644 KB
testcase_12 AC 238 ms
89,728 KB
testcase_13 AC 232 ms
89,564 KB
testcase_14 AC 235 ms
89,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO)
LI = lambda : list(map(int, input().split()))
sys.setrecursionlimit(3*10**5+10)

from fractions import Fraction as f
n,m,k = LI()
val = f(m, n) * f((m-1), (n-1-k)) + f(n-m, n) * f((m) , (n-1-k))
val = max(val, f(m,n))
print(val.numerator, val.denominator)
0