結果

問題 No.129 お年玉(2)
ユーザー lam6er
提出日時 2025-04-16 15:36:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 5,000 ms
コード長 240 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 75,000 KB
最終ジャッジ日時 2025-04-16 15:41:37
合計ジャッジ時間 4,571 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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