結果

問題 No.129 お年玉(2)
ユーザー daku9640
提出日時 2017-02-18 12:05:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 255 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-28 00:44:22
合計ジャッジ時間 3,623 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-

mod = 1000000000

def c(y, x):
    if y // 2 < x: x = y - x;
    t = 1
    for i in range(1, x + 1): t = t * (y + 1 - i) // i
    return t

n = int(input())
m = int(input())
print(c(m, n // 1000 % m) % mod)

0