結果

問題 No.1011 Infinite Stairs
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-16 20:58:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 956 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 30,940 KB
最終ジャッジ日時 2023-09-24 11:23:05
合計ジャッジ時間 9,605 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
29,604 KB
testcase_01 AC 124 ms
29,656 KB
testcase_02 AC 138 ms
29,532 KB
testcase_03 AC 666 ms
30,516 KB
testcase_04 AC 220 ms
29,784 KB
testcase_05 AC 956 ms
30,940 KB
testcase_06 AC 121 ms
29,652 KB
testcase_07 AC 129 ms
29,560 KB
testcase_08 AC 119 ms
29,576 KB
testcase_09 AC 121 ms
29,716 KB
testcase_10 AC 123 ms
29,664 KB
testcase_11 AC 243 ms
29,860 KB
testcase_12 AC 127 ms
29,628 KB
testcase_13 AC 194 ms
29,912 KB
testcase_14 AC 124 ms
29,620 KB
testcase_15 AC 215 ms
29,892 KB
testcase_16 AC 525 ms
30,272 KB
testcase_17 AC 157 ms
29,736 KB
testcase_18 AC 334 ms
30,124 KB
testcase_19 AC 125 ms
29,600 KB
testcase_20 AC 121 ms
29,652 KB
testcase_21 AC 211 ms
29,976 KB
testcase_22 AC 321 ms
29,936 KB
testcase_23 AC 243 ms
30,044 KB
testcase_24 AC 244 ms
30,060 KB
testcase_25 AC 318 ms
29,980 KB
testcase_26 AC 163 ms
29,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
mod = 10 ** 9 + 7

N, d, K = map(int, input().split())
dp = np.zeros(K + 1, dtype=np.int64)
dp[0] = 1

for _ in range(N):
    np.cumsum(dp, out=dp)
    dp %= mod
    dp[d:] -= dp[:-d]
    dp %= mod

print(dp[K - N])
0