結果

問題 No.129 お年玉(2)
ユーザー lam6er
提出日時 2025-04-15 21:29:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 240 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 74,948 KB
最終ジャッジ日時 2025-04-15 21:32:59
合計ジャッジ時間 4,344 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M = int(input())

total = 1000 * M
k = N // total
R = N - k * total
t = R // 1000

if t == 0:
    print(1)
else:
    mod = 10**9
    res = 1
    for i in range(t):
        res = res * (M - i) // (i + 1)
    print(res % mod)
0