結果

問題 No.129 お年玉(2)
ユーザー HachimoriHachimori
提出日時 2015-01-17 09:39:41
言語 Python2
(2.7.18)
結果
AC  
実行時間 326 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-05-05 21:40:33
合計ジャッジ時間 5,509 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,400 KB
testcase_01 AC 326 ms
6,784 KB
testcase_02 AC 10 ms
6,400 KB
testcase_03 AC 9 ms
6,400 KB
testcase_04 AC 9 ms
6,400 KB
testcase_05 AC 102 ms
6,528 KB
testcase_06 AC 56 ms
6,528 KB
testcase_07 AC 125 ms
6,656 KB
testcase_08 AC 148 ms
6,528 KB
testcase_09 AC 43 ms
6,400 KB
testcase_10 AC 152 ms
6,656 KB
testcase_11 AC 70 ms
6,528 KB
testcase_12 AC 11 ms
6,272 KB
testcase_13 AC 10 ms
6,272 KB
testcase_14 AC 54 ms
6,528 KB
testcase_15 AC 49 ms
6,656 KB
testcase_16 AC 73 ms
6,656 KB
testcase_17 AC 33 ms
6,528 KB
testcase_18 AC 132 ms
6,528 KB
testcase_19 AC 212 ms
6,656 KB
testcase_20 AC 97 ms
6,528 KB
testcase_21 AC 42 ms
6,528 KB
testcase_22 AC 87 ms
6,528 KB
testcase_23 AC 146 ms
6,656 KB
testcase_24 AC 241 ms
6,656 KB
testcase_25 AC 64 ms
6,400 KB
testcase_26 AC 115 ms
6,784 KB
testcase_27 AC 106 ms
6,656 KB
testcase_28 AC 88 ms
6,656 KB
testcase_29 AC 9 ms
6,400 KB
testcase_30 AC 10 ms
6,400 KB
testcase_31 AC 9 ms
6,272 KB
testcase_32 AC 9 ms
6,400 KB
testcase_33 AC 10 ms
6,272 KB
testcase_34 AC 9 ms
6,272 KB
testcase_35 AC 9 ms
6,272 KB
testcase_36 AC 10 ms
6,400 KB
testcase_37 AC 10 ms
6,400 KB
testcase_38 AC 17 ms
6,400 KB
testcase_39 AC 15 ms
6,400 KB
testcase_40 AC 25 ms
6,528 KB
testcase_41 AC 46 ms
6,528 KB
testcase_42 AC 25 ms
6,528 KB
testcase_43 AC 10 ms
6,400 KB
testcase_44 AC 250 ms
6,784 KB
testcase_45 AC 18 ms
6,400 KB
testcase_46 AC 10 ms
6,400 KB
testcase_47 AC 197 ms
6,656 KB
testcase_48 AC 153 ms
6,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
#coding:utf8


def read():
    return input(), input()


def work((N, M)):
    toPay  = N / M / 1000 * 1000
    remain = N - toPay * M
    K = remain / 1000

    # M から K 個を選ぶ組み合わせの数
    ans = 1
    for i in range(M - K + 1, M + 1):
        ans *= i
    for i in range(1, K + 1):
        ans /= i
    print ans % 1000000000
    

if __name__ == "__main__":
    work(read())
0