結果

問題 No.129 お年玉(2)
ユーザー HachimoriHachimori
提出日時 2015-01-17 09:39:41
言語 Python2
(2.7.18)
結果
AC  
実行時間 326 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 6,524 KB
実行使用メモリ 6,432 KB
最終ジャッジ日時 2023-08-18 16:31:11
合計ジャッジ時間 6,156 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,156 KB
testcase_01 AC 326 ms
6,432 KB
testcase_02 AC 10 ms
6,004 KB
testcase_03 AC 10 ms
6,012 KB
testcase_04 AC 10 ms
5,972 KB
testcase_05 AC 108 ms
6,192 KB
testcase_06 AC 58 ms
6,196 KB
testcase_07 AC 133 ms
6,276 KB
testcase_08 AC 160 ms
6,376 KB
testcase_09 AC 46 ms
6,232 KB
testcase_10 AC 159 ms
6,364 KB
testcase_11 AC 72 ms
6,192 KB
testcase_12 AC 11 ms
6,000 KB
testcase_13 AC 11 ms
6,068 KB
testcase_14 AC 58 ms
6,296 KB
testcase_15 AC 52 ms
6,196 KB
testcase_16 AC 81 ms
6,296 KB
testcase_17 AC 38 ms
6,124 KB
testcase_18 AC 143 ms
6,304 KB
testcase_19 AC 221 ms
6,276 KB
testcase_20 AC 99 ms
6,188 KB
testcase_21 AC 41 ms
6,168 KB
testcase_22 AC 89 ms
6,248 KB
testcase_23 AC 154 ms
6,352 KB
testcase_24 AC 256 ms
6,396 KB
testcase_25 AC 67 ms
6,224 KB
testcase_26 AC 121 ms
6,396 KB
testcase_27 AC 109 ms
6,380 KB
testcase_28 AC 89 ms
6,296 KB
testcase_29 AC 10 ms
6,248 KB
testcase_30 AC 11 ms
6,192 KB
testcase_31 AC 10 ms
6,104 KB
testcase_32 AC 10 ms
5,972 KB
testcase_33 AC 10 ms
6,012 KB
testcase_34 AC 10 ms
6,108 KB
testcase_35 AC 11 ms
6,052 KB
testcase_36 AC 11 ms
6,132 KB
testcase_37 AC 10 ms
5,988 KB
testcase_38 AC 17 ms
6,136 KB
testcase_39 AC 16 ms
6,184 KB
testcase_40 AC 27 ms
6,156 KB
testcase_41 AC 49 ms
6,204 KB
testcase_42 AC 29 ms
6,272 KB
testcase_43 AC 11 ms
6,012 KB
testcase_44 AC 266 ms
6,400 KB
testcase_45 AC 18 ms
6,236 KB
testcase_46 AC 10 ms
6,000 KB
testcase_47 AC 201 ms
6,348 KB
testcase_48 AC 163 ms
6,372 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