結果

問題 No.129 お年玉(2)
ユーザー roarisroaris
提出日時 2019-08-15 23:08:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,246 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,496 KB
実行使用メモリ 94,728 KB
最終ジャッジ日時 2023-10-19 19:37:18
合計ジャッジ時間 29,819 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
75,384 KB
testcase_01 AC 1,246 ms
94,728 KB
testcase_02 AC 38 ms
51,616 KB
testcase_03 AC 38 ms
51,636 KB
testcase_04 AC 39 ms
51,620 KB
testcase_05 AC 524 ms
80,252 KB
testcase_06 AC 824 ms
85,364 KB
testcase_07 AC 982 ms
89,084 KB
testcase_08 AC 701 ms
82,948 KB
testcase_09 AC 921 ms
87,376 KB
testcase_10 AC 1,038 ms
89,788 KB
testcase_11 AC 640 ms
82,492 KB
testcase_12 AC 828 ms
86,128 KB
testcase_13 AC 867 ms
86,912 KB
testcase_14 AC 838 ms
86,256 KB
testcase_15 AC 707 ms
83,412 KB
testcase_16 AC 784 ms
85,236 KB
testcase_17 AC 954 ms
88,668 KB
testcase_18 AC 888 ms
87,376 KB
testcase_19 AC 948 ms
88,668 KB
testcase_20 AC 935 ms
88,460 KB
testcase_21 AC 1,165 ms
93,948 KB
testcase_22 AC 669 ms
83,064 KB
testcase_23 AC 1,020 ms
90,504 KB
testcase_24 AC 984 ms
89,508 KB
testcase_25 AC 644 ms
82,492 KB
testcase_26 AC 659 ms
82,832 KB
testcase_27 AC 642 ms
82,380 KB
testcase_28 AC 1,173 ms
94,256 KB
testcase_29 AC 38 ms
53,372 KB
testcase_30 AC 39 ms
53,372 KB
testcase_31 AC 43 ms
59,548 KB
testcase_32 AC 43 ms
59,548 KB
testcase_33 AC 60 ms
75,208 KB
testcase_34 AC 48 ms
67,748 KB
testcase_35 AC 59 ms
75,208 KB
testcase_36 AC 61 ms
75,208 KB
testcase_37 AC 63 ms
75,208 KB
testcase_38 AC 174 ms
75,864 KB
testcase_39 AC 244 ms
76,504 KB
testcase_40 AC 602 ms
81,712 KB
testcase_41 AC 384 ms
78,216 KB
testcase_42 AC 191 ms
76,024 KB
testcase_43 AC 189 ms
75,968 KB
testcase_44 AC 1,181 ms
94,412 KB
testcase_45 AC 127 ms
75,476 KB
testcase_46 AC 263 ms
76,760 KB
testcase_47 AC 1,148 ms
93,484 KB
testcase_48 AC 707 ms
83,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M = int(input())
MOD = 10 ** 9

for i in range(M+1):
    next_dp = [0] * (i + 1)
    for j in range(i+1):
        if j in [0, i]:
            next_dp[j] = 1
        else:
            next_dp[j] = (dp[j-1] + dp[j]) % MOD
    dp = next_dp
            
i = N // (M * 1000)
c = (N - M * 1000 * i) // 1000
ans = dp[c]
print(ans)
0