結果

問題 No.1011 Infinite Stairs
ユーザー kurimupykurimupy
提出日時 2020-06-13 00:48:46
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 356 bytes
コンパイル時間 619 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 293,272 KB
最終ジャッジ日時 2023-09-06 11:37:04
合計ジャッジ時間 5,472 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,268 KB
testcase_01 AC 71 ms
71,220 KB
testcase_02 AC 114 ms
82,952 KB
testcase_03 AC 371 ms
215,864 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# Infinite stairs
N, d, K = map(int, input().split())
mod = 10**9 + 7
dp = [[0 for i in range(d*N+10)] for j in range(N+1)]
dp[0][0] = 1
for i in range(1, N+1):
    for j in range(max(0, K-d*(N+1-i)),min(K+1-(N+1-i),d*i+1)+1):
        for k in range(1, min(d+1,j+1)):
             dp[i][j] += dp[i-1][j-k] 
        dp[i][j] %= mod
ans = dp[N][K]
print(ans)
0