結果

問題 No.129 お年玉(2)
ユーザー sekiya9311
提出日時 2016-10-20 01:50:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 176 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2024-11-28 00:35:44
合計ジャッジ時間 2,600 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

def comb(n, r):
	res = 1
	for i in range(int(r)):
		res *= n
		n -= 1
		res //= (i + 1)
	return res

N = input()
M = input()

N //= int(1e3)
N %= M
print comb(M, N) % int(1e9)
0