結果

問題 No.129 お年玉(2)
ユーザー lam6er
提出日時 2025-04-15 21:17:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 5,000 ms
コード長 240 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 81,492 KB
実行使用メモリ 74,752 KB
最終ジャッジ日時 2025-04-15 21:23:37
合計ジャッジ時間 3,620 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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