結果

問題 No.129 お年玉(2)
ユーザー Pump0129Pump0129
提出日時 2018-09-19 17:43:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 649 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 8,524 KB
最終ジャッジ日時 2023-08-18 18:10:50
合計ジャッジ時間 2,554 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,988 KB
testcase_01 AC 22 ms
8,272 KB
testcase_02 AC 14 ms
7,972 KB
testcase_03 AC 15 ms
7,916 KB
testcase_04 AC 15 ms
7,924 KB
testcase_05 AC 18 ms
8,432 KB
testcase_06 AC 21 ms
7,928 KB
testcase_07 AC 25 ms
8,524 KB
testcase_08 AC 20 ms
8,476 KB
testcase_09 AC 22 ms
8,504 KB
testcase_10 AC 23 ms
7,912 KB
testcase_11 AC 22 ms
8,296 KB
testcase_12 AC 19 ms
8,344 KB
testcase_13 AC 19 ms
8,064 KB
testcase_14 AC 22 ms
8,340 KB
testcase_15 AC 20 ms
8,324 KB
testcase_16 AC 21 ms
8,488 KB
testcase_17 AC 22 ms
7,916 KB
testcase_18 AC 21 ms
7,912 KB
testcase_19 AC 20 ms
8,000 KB
testcase_20 AC 23 ms
8,392 KB
testcase_21 AC 24 ms
8,140 KB
testcase_22 AC 20 ms
8,300 KB
testcase_23 AC 23 ms
8,488 KB
testcase_24 AC 20 ms
8,000 KB
testcase_25 AC 20 ms
8,384 KB
testcase_26 AC 21 ms
8,472 KB
testcase_27 AC 21 ms
8,356 KB
testcase_28 AC 26 ms
8,324 KB
testcase_29 AC 14 ms
7,980 KB
testcase_30 AC 15 ms
7,984 KB
testcase_31 AC 15 ms
7,980 KB
testcase_32 AC 14 ms
7,984 KB
testcase_33 AC 14 ms
7,896 KB
testcase_34 AC 13 ms
8,020 KB
testcase_35 AC 14 ms
8,044 KB
testcase_36 AC 14 ms
8,048 KB
testcase_37 AC 14 ms
8,000 KB
testcase_38 AC 14 ms
7,912 KB
testcase_39 AC 15 ms
8,024 KB
testcase_40 AC 19 ms
8,472 KB
testcase_41 AC 17 ms
7,988 KB
testcase_42 AC 15 ms
8,040 KB
testcase_43 AC 15 ms
8,048 KB
testcase_44 AC 22 ms
8,440 KB
testcase_45 AC 15 ms
8,040 KB
testcase_46 AC 16 ms
7,984 KB
testcase_47 AC 24 ms
8,324 KB
testcase_48 AC 19 ms
8,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math


class No129:
    n = 0
    m = 0

    def __init__(self):
        self.n = int(input())
        self.m = int(input())

    def solve(self):
        yen = self.n // 1000
        if yen < self.m:
            return ((math.factorial(self.m) // math.factorial(self.m - yen)) // math.factorial(yen)) % 1000000000
        else:
            amari = yen % self.m
            if amari == 0:
                return 1
            return ((math.factorial(self.m) // math.factorial(self.m - amari)) // math.factorial(amari)) % 1000000000


if __name__ == "__main__":
    que = No129()
    ans = que.solve()
    print(ans)
0