結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー yudai1102jpyudai1102jp
提出日時 2022-02-11 21:51:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 671 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 8,860 KB
最終ジャッジ日時 2023-09-10 02:03:45
合計ジャッジ時間 1,214 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,820 KB
testcase_01 AC 19 ms
8,708 KB
testcase_02 AC 19 ms
8,836 KB
testcase_03 AC 19 ms
8,704 KB
testcase_04 AC 19 ms
8,708 KB
testcase_05 AC 19 ms
8,832 KB
testcase_06 AC 19 ms
8,832 KB
testcase_07 AC 19 ms
8,636 KB
testcase_08 AC 19 ms
8,748 KB
testcase_09 AC 19 ms
8,708 KB
testcase_10 AC 19 ms
8,648 KB
testcase_11 AC 19 ms
8,860 KB
testcase_12 AC 19 ms
8,676 KB
testcase_13 AC 19 ms
8,780 KB
testcase_14 AC 19 ms
8,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys
import heapq
from collections import deque
sys.setrecursionlimit(500*500)

stdin = sys.stdin


def YES(): print('Yes')
def NO(): print('No')
def TAKAHASHI(): print('Takahashi')
def AOKI(): print("Aoki")
def ns(): return stdin.readline().strip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))
def nz(): return list(map(lambda x: int(x)-1, stdin.readline().split()))


MOD = int(1e9+7)


def YES():
    print('Yes')


def NO():
    print('No')


def TAKAHASHI():
    print('Takahashi')


def AOKI():
    print("Aoki")


N, M, K = na()

prime = math.gcd(M*(N-1), N*(N-K-1))
print(M*(N-1)//prime, N*(N-K-1)//prime)
0