結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー asumo0729
提出日時 2022-02-11 21:42:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 1,000 ms
コード長 682 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 54,912 KB
最終ジャッジ日時 2024-06-27 17:38:04
合計ジャッジ時間 1,571 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect
import math
import itertools

stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
inf1 = float('inf')
mod = 10 ** 9 + 7
mod = 998244353
eps = 1e-9
sortkey1 = itemgetter(0)
sortkey2 = lambda x: (x[0], x[1])

###############################################################

N, M, K = lp()
P = M * (N - M) + M * (M - 1)
Q = N * (N - K - 1)
g = math.gcd(P, Q)
P //= g; Q //= g
print(P, Q)
0