結果

問題 No.129 お年玉(2)
ユーザー yuki2006yuki2006
提出日時 2015-01-14 22:35:23
言語 PyPy2
(7.3.8)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 320 bytes
コンパイル時間 432 ms
実行使用メモリ 84,412 KB
最終ジャッジ日時 2023-01-04 19:07:03
合計ジャッジ時間 7,376 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
82,096 KB
testcase_01 AC 138 ms
84,092 KB
testcase_02 AC 87 ms
82,060 KB
testcase_03 AC 88 ms
82,212 KB
testcase_04 AC 86 ms
82,172 KB
testcase_05 AC 107 ms
83,920 KB
testcase_06 AC 101 ms
84,004 KB
testcase_07 AC 117 ms
84,108 KB
testcase_08 AC 114 ms
84,400 KB
testcase_09 AC 102 ms
84,032 KB
testcase_10 AC 121 ms
84,392 KB
testcase_11 AC 106 ms
84,380 KB
testcase_12 AC 87 ms
82,076 KB
testcase_13 AC 87 ms
81,912 KB
testcase_14 AC 101 ms
84,028 KB
testcase_15 AC 101 ms
84,400 KB
testcase_16 AC 106 ms
84,336 KB
testcase_17 AC 99 ms
84,304 KB
testcase_18 AC 117 ms
84,072 KB
testcase_19 AC 125 ms
84,004 KB
testcase_20 AC 110 ms
84,336 KB
testcase_21 AC 98 ms
84,108 KB
testcase_22 AC 107 ms
84,108 KB
testcase_23 AC 118 ms
83,932 KB
testcase_24 AC 127 ms
84,380 KB
testcase_25 AC 104 ms
84,332 KB
testcase_26 AC 110 ms
84,356 KB
testcase_27 AC 108 ms
84,360 KB
testcase_28 AC 110 ms
84,104 KB
testcase_29 AC 86 ms
81,900 KB
testcase_30 AC 85 ms
82,048 KB
testcase_31 AC 85 ms
82,216 KB
testcase_32 AC 85 ms
82,040 KB
testcase_33 AC 84 ms
82,136 KB
testcase_34 AC 87 ms
81,872 KB
testcase_35 AC 85 ms
82,044 KB
testcase_36 AC 88 ms
82,032 KB
testcase_37 AC 86 ms
82,000 KB
testcase_38 AC 91 ms
84,412 KB
testcase_39 AC 91 ms
84,380 KB
testcase_40 AC 94 ms
84,072 KB
testcase_41 AC 98 ms
84,312 KB
testcase_42 AC 95 ms
84,352 KB
testcase_43 AC 86 ms
82,312 KB
testcase_44 AC 132 ms
83,920 KB
testcase_45 AC 94 ms
84,156 KB
testcase_46 AC 86 ms
81,964 KB
testcase_47 AC 127 ms
84,100 KB
testcase_48 AC 116 ms
84,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
M = int(raw_input())

assert 1 <= N <= 10 ** 16
assert 1 <= M <= 10 ** 4
#多倍長解

def C(N, K):
    result = 1
    for i in xrange(1, K + 1):
        result *= (N - i + 1)
        result /= i
    return result


A = (N // 1000) / M
K = (N // 1000) - A * M

ans = C(M, K)%1000000000

print ans

0