結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー horitaka1999horitaka1999
提出日時 2022-02-16 21:40:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 170 bytes
コンパイル時間 1,293 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 71,324 KB
最終ジャッジ日時 2023-09-11 17:14:59
合計ジャッジ時間 2,468 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,992 KB
testcase_01 AC 69 ms
71,144 KB
testcase_02 AC 69 ms
71,236 KB
testcase_03 AC 69 ms
71,324 KB
testcase_04 AC 69 ms
71,136 KB
testcase_05 AC 70 ms
70,892 KB
testcase_06 AC 69 ms
71,100 KB
testcase_07 AC 72 ms
71,140 KB
testcase_08 AC 68 ms
71,072 KB
testcase_09 AC 69 ms
71,100 KB
testcase_10 AC 68 ms
70,892 KB
testcase_11 AC 70 ms
71,032 KB
testcase_12 AC 69 ms
71,224 KB
testcase_13 AC 69 ms
70,888 KB
testcase_14 AC 73 ms
70,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int,input().split())
P = M * (N-1)
Q = N * (N-K-1)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
g = gcd(P,Q)
P //= g
Q //= g
print(P,Q)


0