結果

問題 No.129 お年玉(2)
コンテスト
ユーザー takubokudori
提出日時 2017-08-18 23:24:47
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
RE  
実行時間 -
コード長 277 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 81,316 KB
実行使用メモリ 82,876 KB
最終ジャッジ日時 2026-07-18 16:01:13
合計ジャッジ時間 5,136 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 WA * 4 RE * 40
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n=input("")
n=int(n) # 入力されるデータ数
m=input("")
m=int(m)
if n<1000:
    print("0")
    exit(0)

MAX=1000000000
n=int(n/1000)
n=n%m

s1=1
s2=1
for i in range(n):
    if m-i>0:
        s1=s1*(m-i)
    s1=s1%MAX
    s2=s2*(i+1)
    s2=s2%MAX

print(int(s1/s2)%MAX)
0