結果

問題 No.129 お年玉(2)
ユーザー tnoda_
提出日時 2015-08-12 00:35:56
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 216 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-07-18 06:47:36
合計ジャッジ時間 2,369 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 RE * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

def fact(x):
    if x == 0:
        return 1
    else:
        return x * fact(x - 1)

def comb(r, c):
    return fact(r) / fact(r-c) / fact(c)

N = input()
M = input()
N /= 1000
N %= M
print(comb(M, N) % 1000000000)
0